Skip to content

Instantly share code, notes, and snippets.

@rdswift
Created June 30, 2024 17:14
Show Gist options
  • Save rdswift/5f981aa2889c1b6db5d30502550b52c8 to your computer and use it in GitHub Desktop.
Save rdswift/5f981aa2889c1b6db5d30502550b52c8 to your computer and use it in GitHub Desktop.
Example Picard Scripts to Create Variables Before Removing Tags

To remove some tags from the files but still have the values available to use in the file naming script, you may first need to save them to temporary variables in a tagging script such as:

$noop( Create temporary variables )
$set(_temp_albumartist,%albumartist%)
$set(_temp_discnumber,%discnumber%)
$set(_temp_totaldiscs,%totaldiscs%)
$set(_temp_compilation,%compilation%)

$noop( Remove unwanted tags )
$delete(albumartist)
$delete(discnumber)
$delete(totaldiscs)
$delete(compilation)

Then the file naming script would use the variables that were created, rather than the tags that are being deleted. The file naming script might look something like:

$if(%_temp_compilation%,,$if2(%_temp_albumartist%,%artist%) - )%album%/
$if($gt(%_temp_totaldiscs%,1),%_temp_discnumber%-,)$num(%tracknumber%,2) %title%
$if($eq(%_temp_albumartist%,%artist%),, - %artist%)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment