Hi
I'm trying to generate a filename for playlists for each album. The code below works - ie the replacement of the / and : with a - works as does the double quotes with 2 singles, but the code where I am trying to replace 3 dots at the end of an album string with nothing does not work.
So if the album tag is "For All We Shared..." I want the filename of the playlist to be "For All We Shared.m3u8"
you can test expression in Convert>Tag-Tag.
Have you tested $eql($right(%album%,3),...)?
The result is a boolean value, no string. You would have to supply the string now - probably in a $if() statement.
Anyway: why so complicated? Why don't you replace sinply 3 dots with nothing? $replace(%albumartist% - $cutleft(%album%,6),...,,/,-,:, -,",'')
Are you also sure about the $cutleft()
E.g. and album like "... and then there were three ..."
would be come
"d then there were three ..."
plus the removal of the trailing dots:
"d then there were three "
To compare strings: $if($eql(string1,string2),true do this,false do this) $if($eql($right(%album%,3),...),...,)
Thanks. This works. The reason I use $cutleft is because all my albums have the year, colon and space appended at the front of them so they show up in correct order on an iPod/iPhone etc. Even though I have an albumsort tag I like to see the year and album was released when playing it. I didn't want this to appear at the front of the playlist name
Hi, just realised I need to do the same for 2 dots (easy now) but also a single dot - which is proving a problem. I'm guessing this is because a single dot is a reserved character so the following does not work:
$if($eql($right(%album%,1),.),.,)
Have tried the following but this also does not work
$if($eql($right(%album%,1),\.),\.,)
Basically its replacing all instances of a single dot in the filename. So "Born in the U.S.A." becomes "Born in the USA.m3u8 rather than "Born in the U.S.A.m3u8
I have rechecked where there are 3 dots in an album title, where the 3 dots do NOT appear at the end and that works fine - i.e. the 3 dots are not replaced when not at the end but are replaced when at the end of the title
Yes, this is logical as the test is "is there a dot at the end of ALBUM?" which it is.
And as now the dot gets restored, the replace instruction is: "replace a(ny) dot with nothing" which leads to the removal of all dots.
So perhaps you replace the dots as final step after you did all the other processing.
Thanks for the suggestion. I managed to get this to work yesterday using a different technique - don't know why I didn't think of it before. Code below:
This is marginally related, but I noticed that a regex replace in _FILENAME replaces also the dot next to a file extension (.mp3) while simple replace does not.