Help with refining picard script as well as how to sort radio and dj sets

Maybe use something like:

[$if(%_bits_per_sample%,%_bits_per_sample%-bit $div(%_sample_rate%,1000) kHz$if(%_source%, %_source%),%_bitrate%kbps %_extension%)]

That will use %_bitrate%kbps %_extension% if there is not %_bits_per_sample%.

I personally use a small plugin that gives me a $is_lossy() and $is_lossless() function, see Categorizing lossless music - #2 by outsidecontext . I never submitted this to the plugins list as it is kind of a hack and not 100% reliable, but it totally works for my use cases.

The characters not being allowed in Windows file names and hence getting replaced are ["*:<>?|]. Not sure which of those you want to replace with a comma, but you could wrap your entire naming script with a replacement, such as:

$replace(your naming script here,:,\,)

That would replace colons with a comma.

Two special cases are slash / and backslash \. As those are used as directory separators they get replaced with underscores before they reach the naming script. If you want to deal with those you need to handle this before, e.g. with a script modifying the tags or variables. E.g. if you want to replace a / in the artists add a script like this:

$set(_artist_for_filenaming,$replace(%artist%, /,\,))

This will add a variable %_artist_for_filenaming% which has the / replaced with a comma. Then in your file naming script you replace you use of `%artist% with

$if2(%_artist_for_filenaming%,%artist%)

The if2 is used to get a fallback in case %_artist_for_filenaming% is not set in situations where your other script has not run (e.g. if you save untagged files).

Yes. You’ll need to find out how to distingiush those cases then, I think you can use releasetype for your cases. Something like

$if($in(%releasetype%,audiobook),audiobooks,$if($in(%releasetype%,dj-mix),dj-mixes,music))

Not sure how radio shows are handled.

2 Likes