[Logo] Jaikoz and SongKong Forums
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Applying an appended tag to 'Rename Folder from Metadata'  XML
Forum Index -> Jaikoz Questions
Author Message
beatlogik

Pro

Joined: 19/06/2015 03:09:21
Messages: 21
Offline

Hi all,

I'm wondering if 'rename mask' code exists for appending a selected tag to become the name of the folder in 'Rename Folder from Metadata'

Here is my scenario:

I am organizing the folder structure to my entire collection based on genre. My genre tagging system lists the general genre with a series of sub-genre codes in the same field.

EG: House [deep][soulful]

Ideally I'm trying to develop an organizational system that houses all the tracks tagged as "House" into one folder with the sub-genres as their own folders within.

EG: Base Folder/House/[deep][soulful]/Track XX

or even more simply: Base Folder/House/Track XX

I do realize that I can tag the sub-genres in a separate field and include this in the mask, but most of my fields are already being used in the DJ software workflow that I am using as it has a limited list of ID3 tags visible to the user.

Any help would be greatly appreciated.

Thanks!
Erik
paultaylor

Pro
[Avatar]

Joined: 21/08/2006 09:21:27
Messages: 7485
Offline

So are you saying your Genre field currently contains values such as

Code:
House [deep][soulful] 


So is the format

Code:
MainGenre[SubGenre1][SubGenre2]


If it is then yes you should be able to use Javascript expressions to split the genre field into two parts and use each part for a different subfolder in your Preferences:File and Folder Correct:Rename Folder from Metadata
masks.

Because the format is Javascript Expressions you can use any Javsscript reference to work out how to do it.

thanks Paul (Administrator)
beatlogik

Pro

Joined: 19/06/2015 03:09:21
Messages: 21
Offline

This is how my genre field typically looks, correct.

Are there any risks in splitting the genre field in 2 parts? Would it introduce unexpected behavior from media players reading that tag?

My coding background is pretty limited btw.
beatlogik

Pro

Joined: 19/06/2015 03:09:21
Messages: 21
Offline

I suppose I could always have the genre folder names reflect the subgenres as well, although it would yield 1000s of folders considering that I like to be very specific in the subgenre field.

Id be interested to know if any other users utilize this type of structure.
chillware

Pro

Joined: 17/11/2010 13:13:39
Messages: 99
Offline

I use a similar setup for my folders and the problem i run in to is if the tags are empty or missing you end up with a lot of empty square brackets in your folder names, ex. [] []. Especially going to be a problem for you if you are going to use that for your actual sub-folders with multiple albums under it, you might end up with a lot of albums under folder named \[]\.

What we really need is (and I'm sure its possible, just don't know how) is a If Not Empty, Then type of statement.
paultaylor

Pro
[Avatar]

Joined: 21/08/2006 09:21:27
Messages: 7485
Offline

Hi chiillware that is what the ifnotempty function is for do you want to post your mask and I will try and sort them both out later.

thanks Paul (Administrator)
paultaylor

Pro
[Avatar]

Joined: 21/08/2006 09:21:27
Messages: 7485
Offline

Okay this seems to work, just paste into Rename mask (and compilation mask) on the Rename Folder from Metadata

Code:
 if(genre.length > 0)
 {
   if(genre.indexOf('[')>0)
   { 
       genre.substring(0,  genre.indexOf('[') ) + folderseparator  + genre.substring(genre.indexOf('[') )  		  		
   }
  else
   {
      genre + folderseparator 
   } 
 }
 else
 {
 }
 


I think its self explanatory but basically if the genre field is not empty and contains a '[' its splits the genre field at this point and uses it to create two folders. If the genre field is not empty but doesnt contain a '[' then it uses the whole field as a a single folder so you dont end up with empty[] folders

thanks Paul (Administrator)
 
Forum Index -> Jaikoz Questions
Go to:   
Powered by JForum 2.1.6 © JForum Team