[Logo] Jaikoz and SongKong Forums
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Help Create Filename Mask  XML
Forum Index -> SongKong Questions
Author Message
map856



Joined: 06/05/2019 18:01:07
Messages: 3
Offline

I'm hoping to get some hints as to how to append a Subtitle string to the album title to form a Folder name. For example, if I have 2 versions of The Beatles Abbey Road, I'd like my folder structure to appear as follows:

Beatles, The
Abbey Road
Abbey Road [2009 Remaster] (where 2009 Remaster is in the Subtitle field)

This will help group tracks together and prevent the same tracks potentially being overwritten or duplicated, listed under the same Abbey Road subfolder.

Right now, I use the following mask:

Code:
function swapprefix(value) {
  if(value.startsWith("The ") || value.startsWith("A "))
     {
        value = albumartistsort
        return value;
     }
 
     else
     {
        return value;
     }
  }
 
 ifnotempty2(swapprefix(albumartist),"Various Artists",'/')
 + ifnotempty(album,'/')
 + ifmultidisc(ifnotempty(discno,'-'))
 + ifnotempty(pad(trackno,2),' ')
 + ifnotempty(artist,' - ')
 + title


What's the best way to append the subtitle string (if it exists / is not empty) in square brackets to the album name part of the folder structure?

Many thanks.
paultaylor

Pro
[Avatar]

Joined: 21/08/2006 09:21:27
Messages: 7967
Online

Hi, we don't actually use the SubTitle field and its not currently available with Manual Edit either so unless you had added it manually this will not have any effect. But assuming you have added it then I would do the following

1. Create a brackets function that put subtitle in barckets (with leading space) if it exists.
2. Call it after you display album

e.g
Code:
 function swapprefix(value) {
   if(value.startsWith("The ") || value.startsWith("A "))
      {
         value = albumartistsort
         return value;
      }
  
      else
      {
         return value;
      }
   }
  
 function brackets(value){
      return value.length > 0 ? ' [' + value + ']' : '';
  }
 
  ifnotempty2(swapprefix(albumartist),"Various Artists",'/')
  + ifnotempty(album + brackets(subtitle),'/')
  + ifmultidisc(ifnotempty(discno,'-'))
  + ifnotempty(pad(trackno,2),' ')
  + ifnotempty(artist,' - ')
  + title
 

thanks Paul (Administrator)
map856



Joined: 06/05/2019 18:01:07
Messages: 3
Offline

Thanks Paul, that's brilliant! It looks so simple and obvious once you know what to do

You say that SongKong doesn't use SubTitle. You're probably right - I must have added the field manually at some point in the past but not many of my albums use it. I find it handy though to distinguish between the various versions of some of my albums.

In the absence of SubTitle, is there an alternative field that SongKong uses that could serve the same purpose?

Many thanks.

Martin
paultaylor

Pro
[Avatar]

Joined: 21/08/2006 09:21:27
Messages: 7967
Online

SongKong understands subtitle it just doesnt automatically populate it so I think its make sense for you to use it.

In the Format tab you can adjust the Album field so it additionally contains items such as Audio Format/Album Type and if if HighDef, and you could also make use of these fields (e.g mbreleasetype) to amend your filename.

thanks Paul (Administrator)
map856



Joined: 06/05/2019 18:01:07
Messages: 3
Offline

OK, so in that case, using SubTitle is probably a good way for me to go.

Thanks again for your help Paul.

Cheers.

Martin
 
Forum Index -> SongKong Questions
Go to:   
Powered by JForum 2.1.6 © JForum Team