salty-picard-script.txt 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. $noop(Remove Unicode lookalikes)
  2. $setmulti(_unicode_src,0; 1; 2; 3; 4; 5; 6; 7; 8; 9; ◌; ‘; ’; ‚; ‛; “; ”; „; ‟; ‐; ‑; –; —; ‒; ―; ․; ‥; …; ‼; ⁇; ⁄; ∕; /; 〜; ~; (; [; <; ); ]; >; ?; !; :)
  3. $setmulti(_unicode_dst,0; 1; 2; 3; 4; 5; 6; 7; 8; 9; ; '; '; \,; '; "; "; "; "; -; -; -; -; -; -; .; ..; ...; !!; ??; /; /; / ; ~; ~; \(; [; <; \) ; ] ; >; ? ; ! ; :)
  4. $foreach(artist; albumartist; title; album; composer; discsubtitle,
  5. $set(_tag,%_loop_value%)
  6. $foreach(%_unicode_src%,
  7. $set(_search,%_loop_value%)
  8. $set(_replace,$getmulti(%_unicode_dst%,$add(%_loop_count%,-1)))
  9. $set(%_tag%,$replace($get(%_tag%),%_search%,%_replace%))
  10. $set(%_tag%,$trim($rreplace($get(%_tag%), +, )))
  11. )
  12. )
  13. $noop(Consistent spacing for CV credits)
  14. $foreach(artist; albumartist,
  15. $set(%_loop_value%,$rreplace($get(%_loop_value%),\(?i\) *\\\( *CV[.::]? *, \(CV: ))
  16. )
  17. $noop(Format MusicBrainz enums for display)
  18. $setmulti(releasetype,$title($replace(%releasetype%,ep,EP)))
  19. $noop(Remove unwanted MusicBrainz tags)
  20. $delete(musicbrainz_originalartistid)
  21. $delete(musicbrainz_originalalbumid)
  22. $delete(musicbrainz_discid)
  23. $delete(musicbrainz_workid)
  24. $noop(Prefer BARCODE tag over UPC tag)
  25. $if(%upc%,$set(barcode,%upc%))
  26. $delete(upc)
  27. $noop(Ignore [none] barcode)
  28. $replacemulti(%barcode%,[none],)
  29. $cleanmulti(barcode)
  30. $noop(Ignore [none] catalog number)
  31. $replacemulti(%catalognumber%,[none],)
  32. $cleanmulti(catalognumber)
  33. $noop(Ignore catalog number for Digital Media)
  34. $if($eq_any(%media%,Digital Media),$delete(catalognumber))
  35. $noop(Ignore soundtrack type on non-album releases)
  36. $if($in(%releasetype%,Album),,
  37. $replacemulti(%releasetype%,Soundtrack,)
  38. $cleanmulti(releasetype)
  39. )
  40. $noop(Keep only essential tags)
  41. $keep(encoder,artist,title,album,albumartist,composer,releasetype,date,tracknumber,discnumber,discsubtitle,totaldiscs,totaltracks,isrc,barcode,catalognumber,media,source,url)