SongKong Jaikoz

SongKong and Jaikoz Music Tagger Community Forum

filename mask, I am requesting a lot here, 2019-05-26

Can you create a filename mask to do this below?:

FOLDERS LIKE THIS:
Example: B/Beatles, The/Revolver Flac/{then all song filenames}
The first two folders “B/Beatles, The” are the AlbumArtistSort, or ArtistSort.
The album folder adds [codec] (year).
Where artistsort, artist, album, title are all each limited to 40 characters.
And if multidisc, add something for that.

SONG FILENAMES
Example: 01 Taxman (749kbps 1966)
The year is the originalyear.
Where title is limited to 40 characters.

AND, in the album folder:
if Compilation, add (Comp), not (Compilation),
if Greatest Hits, add (GH)
if Various Artists, add (VA)

AND, do the tricks that make it more versatile, like:
the “ifs”: ifnotempty, ifmultidisk,
the “year” in folders and songfilename are 4 digit without month or day.

Here is what I have so far. The mask name is bb1:

ifnotempty4(albumartistsort.substring(0,1),artistsort.substring(0,1),albumartist.substring
(0,1),artist.substring(0,1),’/’)

  • ifnotempty4(albumartistsort.substring(0,40),artistsort.substring(0,40),albumartist.substring
    (0,40),artist.substring(0,40),’/’)

  • ifnotempty(album.substring(0,40),’ ')

  • ‘(’ + (year.length>4 ? year.substring(0,4):year) + ‘) ’
    +’/’

  • ifmultidisc(‘D’ + ifnotempty(pad(discno,1),’/’))

  • ifnotempty(pad(trackno,2),’ ')

  • ifnotempty(title,’ ')

  • ‘(’ + (originalyear.length>4 ? originalyear.substring(0,4):originalyear) + ’ ’

  • audiobitrate + ‘kbps)’

example results:

B\Band, The\The Last Waltz (Live) (Flac) (2002)\D1\
01 Theme From The Last Waltz (2002 872kbps).flac
02 Up on Cripple Creek (1969 947kbps).flac
03 The Shape I’m In (1970 964kbps).flac
04 It Makes No Difference (1975 919kbps).flac
05 Who Do You Love (Ft. Ronnie Hawkins) (1978 899kbps).flac
… and so on.

Overall I am happy with the results. This album release has 4 discs.
I may change kbps to
02 Up on Cripple Creek (1969@947).flac

Notice the album result show (Live) and (Flac), but they are not in my mask. I also get (Compilation) when not in my mask. I guess these get added to the album name automatically and a songkong user has no control over it.

In this example, all the songs were live recorded in 1978. It would be nice if the album name had (Live 1978) instead of just (Live).

I would think 1978 would be the originalyear, but originalyear is the first time the song name was recorded, not the first time the subject song was recorded.
For example, “Up on Cripple Creek” had its first recording in studio in 1969. And then recorded live in 1978. Is a new performance a new song? I guess it gets messy to decide this. I assume the issue is not songKong, but is the database convention.

using the same mask bb1 for various artist i get example:
V\Various Artists\80’s Pop Hits (Compilation) (Mp3) (2001)\D2
01 Girls Just Want to Have Fun (1983 320kbps).mp3
02 Shake You Down (1986 320kbps).mp3
03 Carrie (1986 320kbps).mp3
so I need to add artist to song name, and shorten the 1st and 2nd folder to “VA\”.
VA\80’s Pop Hits (Compilation) (Mp3) (2001)\D2

using the built-in mask for VA i get:
VA - 80’s Pop Hits (Compilation) (Mp3) (2001)
01 - Cyndi Lauper - Girls Just Want to Have Fun.mp3
02 - Gregory Abbott - Shake You Down.mp3
03 - Europe - Carrie.mp3
so I need to add disc, originalyear and kbps.

In this example, all are 320kbps. It would be nice if that could automatically go in the album folder name instead, when all songs have the same kbps.

Now I see (Live) (Flac) and (Compilation) are under my control, in the “Fix Songs” dialog box in the tab “Format”.

But I am not sure how to shorten
Compilation to Comp
Greatest Hits to GrHits

I think if i uncheck boxes in the “Fix Songs” dialog box in the tab “Format”, then I can shorten Compilation and Greatest Hits by using a file mask. The journey continues.

You could create some replace functions

function replaceCompilation(contents)
{
  return contents.replace("Compilation", "Comp");
}
function replaceGreatestHits(contents)
{
  return contents.replace("Greatest Hits", "GrHits");
}

and then use them in your mask e.g

replaceGreatestHists(replaceCompilation(title))