Slash is special because we use it to signify a folder so if we don’t convert it when found in metadata extra folders are created where user does not want them.
Other special characters such as * can be converted easily yourself in your rename mask.If you don’t do anything then they are automatically removed if invalid for the operating system they are being created on.
For example we create a r function that uses replaceAll to replace various characters with +. Note because ?, * and \ are special characters in replaceAll function (because it represent a regular expression) we have to escape them with the extra \ . We dont need to that for : because that is not special character for regular expressions.
We then use the r function passing our mask as parameter.
function r(value)
{
return value
.replaceAll("\\?","+")
.replaceAll("\\*","+")
.replaceAll("\\\\","+")
.replaceAll(":","+");
}
r(albumartist + '/'
+ ifnotempty(album,'/')
+ ifnotempty(pad(discno,2),' - ')
+ ifnotempty(pad(trackno,2),' - ')
+ title);