Hi Paul, it’s been some time! Just wondering as I tried a few approaches in the Filename mask, but I am not good with JavaScript and GPT is no help so far:
This has been my “base script” for some years:
ifnotempty2(albumartistsort.substring(0,1),"Z albumartistsort tag not found",'/')
+ ifnotempty2(albumartistsort,"Z albumartistsort tag not found",'/')
+ ifnotempty((year.length>4 ? year.substring(0,4):year),' ')
+ ifnotempty(album,'/')
+ ifmultidisc(ifnotempty(pad(discno,2),'-'))
+ ifnotempty(pad(track,2),' ')
+ title
-
Any general observations? What could be improved for “robustness”?
-
How would change it so that ifmultidisc = yes, append it to album level in the structure like
- ifnotempty(album,’ ')
- ifmultidisc(ifnotempty(pad(discno,2),’/’))
Problem here is that only very few releases have multiple discs and this destroys my folder structure.
So in other words - how do I implement a conditional prepend separator rather than a conditional append separator ? Hope my question is clear.
-
I want to generally change from albumartistsort to albumartist but for names starting with The, push that back like “Beatles, The” . Do you see any way of scripting that? I tried the following so far, but none is recognized and I am at my limited scripting wits end:
a)ifnotempty( ifcontains(albumartist, "The ", removeleft(albumartist, 4) + ", The", albumartist), " - " ) + title
b)
ifnotempty(
ifmatch(albumartist, "^The (.+)", word(1) + ", The"),
"/"
) + title
c)
if(artist=~"^The (.+)", fixcase("$1, The"), artist)
d)
if(startswith(albumartist,"The "),
substringafter(albumartist,"The ") + ", The",
albumartist
)