Tagging script

From Things and Stuff Wiki
Revision as of 23:35, 17 January 2019 by Milk (talk | contribs)
Jump to navigation Jump to search




See New new final


basic formatting tests (see bottom for final);

Puddletag directory spaces to _:
$replace($validate(%artist%,,’`'/\*?;”|:)," ","_")/$replace($validate(%artist%,,’`'/\*?;”|:)," ","_")-%year%-$replace($validate(%album%,,’`'/\*?;”|:)," ","_")

Puddletag file spaces to _:
$replace($validate(%artist%,,’`'/\*?;”|:)," ","_")-%year%-$replace($validate(%album%,,’`'/\*?;”|:)," ","_")-$num(%track%,2)-$replace($validate(%title%,,’`'/\*?;”|:)," ","_")


 Puddletag directory remove spaces:
$validate($if(%albumartist%,%albumartist%,%artist%),,’`'/\*?;”|: )/$validate($if(%albumartist%,%albumartist%,%artist%),,’`'/\*?;”|: )-%year%-$validate(%album%,,’`'/\*?;”|: )/


 Puddletag file remove spaces:
$validate($if(%albumartist%,%albumartist%,%artist%),,’`'/\*?;”|: )-$if($neql(%artist%,%albumartist%),%artist%-,)%year%-$validate(%album%,,’`'/\*?;”|: )-$num(%track%,2)-$validate(%title%,,’`'/\*?;”|: )

$validate($if(%albumartist%,%albumartist%,%artist%),,’`'/\*?;”|: )-$if($neql(%artist%,%albumartist%),%artist%-,)%year%-$validate(%album%,,’`'/\*?;”|: )-$num(%track%,2)-$validate(%title%,,’`'/\*?;”|: )


redo:
%artist%/%artist%-%year%-%album%/ %artist%-%year%-%album%-%track%-%title%
%albumartist%/%albumartist%-%year%-%album%/ %albumartist%-%year%-%album%-%track%-%artist%-%title%

$if(%albumartist%,%albumartist%,%artist%)/$if(%albumartist%,%albumartist%,%artist%)-%year%-%album%/$if(%albumartist%,%albumartist%,%artist%)-%year%-%album%-%track%$if(%albumartist%,-%artist%,)-%title%


$validate(,,’`'”-/\|;:*?!&\[]<>,.)


Schema: albumartist = various artists compilation album. An if to see if albumartist and artist is different would fail for compilations including a track by the album artist.


Final:

 Puddletag file remove spaces + albumartist ifs:
$validate($if(%albumartist%,%albumartist%,%artist%),,’`'/\*?;”|: -&\[],.)/$validate($if(%albumartist%,%albumartist%,%artist%),,’`'/\*?;”|: -&\[],.)-%year%-$validate(%album%,,’`'/\*?;”|: -&\[],.)/$validate($if(%albumartist%,%albumartist%,%artist%),,’`'/\*?;”|: -&\[],.)-%year%-$validate(%album%,,’`'/\*?;”|: -&\[],.)-$num(%track%,2)$if(%albumartist%,-$validate(%artist%,,’`'/\*?;”|: -&\[],.),)-$validate(%title%,,’`'/\*?;”|: -&\[],.)

Produces directory path and filenames like this:

/media/3tb/media/music/FLAC/Decapitated/Decapitated-2000-04-17-WindsofCreation/Decapitated-2000-04-17-WindsofCreation-05-Decapitated-TheEyeofHorus.flac


New final:

 Puddletag file spaces to underscores + albumartist ifs:
$replace($validate($if(%albumartist%,%albumartist%,%artist%),,’`'/\*?;”|:-&\[],.)," ","_")/$replace($validate($if(%albumartist%,%albumartist%,%artist%),,’`'/\*?;”|:-&\[],.)," ","_")-%year%-$replace($validate(%album%,,’`'/\*?;”|:-&\[],.)," ","_")/$replace($validate($if(%albumartist%,%albumartist%,%artist%),,’`'/\*?;”|:-&\[],.)," ","_")-%year%-$replace($validate(%album%,,’`'/\*?;”|:-&\[],.)," ","_")-$num(%track%,2)$if(%albumartist%,-$replace($validate(%artist%,,’`'/\*?;”|:-&\[],.)," ","_"),)-$replace($validate(%title%,,’`'/\*?;”|:-&\[],.)," ","_")


How does evaluation work? test:

$replace($validate($if(%albumartist%,%albumartist%,%artist%)/$if(%albumartist%,%albumartist%,%artist%)-%year%-%album%/$if(%albumartist%,%albumartist%,%artist%)-%year%-%album%-%track%$if(%albumartist%,-%artist%,)-%title%,,’`'/\*?;”|:-&\[],.)," ","_")

Ah, evaluation stops at directory slashes.

Produces directory path and filenames like this:

/media/3tb/media/music/FLAC/Decapitated/Decapitated-2000-04-17-Winds_of_Creation/


Decapitated-2000-04-17-Winds_of_Creation-05-Decapitated-The_Eye_of_Horus.flac

2_Many_DJs-2002-As_Heard_on_Radio_Soulwax,_Part_2-01-Emerson,_Lake__Palmer__Basement_Jaxx-Peter_Gunn_(live)_vs._Wheres_Your_Head_At_(HeadaPella)._2-22-Emerson,_Lake__Palmer__-Human_Fly_(The_Cramps)

Be careful when copying and pasting this - a new line character might be added to the end.


Formatting rule: Puddletag file spaces to underscores + albumartist ifs:

$replace($validate($if(%albumartist%,%albumartist%,%artist%),,’`'”-/\|;:*?!&\[]{}<>,.)," ","_")/$replace($validate($if(%albumartist%,%albumartist%,%artist%),,’`'”-/\|;:*?!&\[]{}<>,.)," ","_")-%year%-$replace($validate(%album%,,’`'”-/\|;:*?!&\[]{}<>,.)," ","_")/$replace($validate($if(%albumartist%,%albumartist%,%artist%),,’`'”-/\|;:*?!&\[]{}<>,.)," ","_")-%year%-$replace($validate(%album%,,’`'”-/\|;:*?!&\[]{}<>,.)," ","_")-$num(%track%,2)$if(%albumartist%,-$replace($validate(%artist%,,’`'”-/\|;:*?!&\[]{}<>,.)," ","_"),)-$replace($validate(%title%,,’`'”-/\|;:*?!&\[]{}<>,.)," ","_")

Issues(?):

  • double __?
  • remove accidental trailing whitespace?
  • paren brackets


Remember to:

  • avoid blank years
  • avoid blank album/artist names
  • check if some album artists should be "Various Artists" or a performer/DJ/curator name