SongKong Jaikoz

SongKong and Jaikoz Music Tagger Community Forum

Folder renaming question

Dear All I am trying to set a folder renaming template to my taste.
I am using this setting as a template from “AlbumArtistorArtist/Album/DiscIfMultiDisc/Track - Title”

ifnotempty2(albumartist,artist,'/')
+ ifnotempty(album,'/')
+ ifmultidisc('Disc ' + ifnotempty(pad(discno,2),'/'))
+ ifmultidisc(ifnotempty(pad(discno,2),' - '))
+ ifnotempty(pad(trackno,2),' - ')
+ title

As default this template works very well for multi disc albums as below.
image

What I want to do is adding release year next to album name to obtain “AlbumArtistorArtist/Album (year)/DiscIfMultiDisc/Track - Title”

For this purpose I cloned the above template and add year line as below

ifnotempty2(albumartist,artist,'/')
+ ifnotempty(album,' ')
+ '(' + (albumyear.length>4 ? albumyear.substring(0,4):albumyear) +')/'
+ ifmultidisc('Disc ' + ifnotempty(pad(discno,2),'/'))
+ ifmultidisc(ifnotempty(pad(discno,2),' - '))
+ ifnotempty(pad(trackno,2),' - ')
+ title

But this caused a problem for the folder names and I got a result given below
image
image

In this settings it try to create a folder with same name for each disc in the album

Likewise I also need to generate similar template for the multi disc compilations. I will get similar issue as below for the “VA - Album(Year)/Track - Artist - Title” template. Same folder name for each disc.
image

"Va - "
+ ifnotempty(album,' ')
+ '(' + (albumyear.length>4 ? albumyear.substring(0,4):albumyear) +')/'
+ ifnotempty(pad(trackno,2),' - ')
+ ifnotempty(artist,' - ')
+ title

For this template multi disc section needs to be added

My ultimate goal is to obtain folder structure as Artist (VA (if compilation))/Album (year)/disc no (if multidisc)/track no - title

Any help will be appreciated.

So are you saying that you ended up with

Blue Note Trip, Volume 5 Scrambled - Mashed (2006)/Disc 01
Blue Note Trip, Volume 5 Scrambled - Mashed (1) (2006)/Disc 02

instead of

Blue Note Trip, Volume 5 Scrambled - Mashed (2006)/Disc 01
Blue Note Trip, Volume 5 Scrambled - Mashed (2006)/Disc 02

If so I think this may not be strictly related to your rename mask (that looks okay), but more to do with the logic that trys to handle duplicate files ectera when renaming, this code may need some further tuning. Try rerunning Fix Songs to see if that resolves it or not.

Dear Paul Thank you for your reply and yes you are correct on the situation. I tried several things and I have found that the problem is the “space” inside quotation marks.
+ ifnotempty(album,’ ') if I use this code it will end up with the problematic case as you and I described.

But when I remove the space and replace it with hyphen as + ifnotempty(album,’-’) then code work.

Blue Note Trip, Volume 5 Scrambled - Mashed-(2006)/Disc 01
Blue Note Trip, Volume 5 Scrambled - Mashed-(2006)/Disc 02

but whenerver I put space inside quotation marks agan it end up with the wrong case such as + ifnotempty(album,’ - ') Therefore I cannot reach to case below

Blue Note Trip, Volume 5 Scrambled - Mashed - (2006)/Disc 01
Blue Note Trip, Volume 5 Scrambled - Mashed - (2006)/Disc 02

It doesn’t quite make sense to me why the space would cause a particular problem, can you check that if you retry running Fix Songs with the problem rename mask a number of times do the filenames get modified at all or do they stay exactly the same after each run ?

Okay raised as https://jthink.atlassian.net/projects/SONGKONG/issues/SONGKONG-2232

Dear Paul
If I re run the same code then it will correct the folder names but in this case I have to detect all the folders having this issue manually and rerun the fixing again, which is not practical for large libraries

Yeah I know, what I am saying though is your rename mask is fine, the problem is with renaming functionality for multi disco albums and I expect to fix for next release.

Fixed by SongKong 7.4 released 9th June 2021