- Moderator
- #1
Hello,
i want to share my script for rename/move Audio files using Musicbrainz Picard.
for information, an portable is available on portableapps.com, i use it for use it as portable and not lost my setting, because all settings are stored inside windows registry
the convention is :
for sorting by albumartist, if the tag is missing you need to add it before save files.
don't forget to remove album / track, if the file is alone or you want it
for the discnumber before title, the tag " %totaldiscs% must be present, only use the %discnumber% will break the convention.
Adapt the code to the Various Artists name from your setting :
$set(_variousartist,Various Artists)
if you see few error during renaming, you can includ for example : XXX1XXX before " %artist% -" for know what line is used for your files.
the code is not perfect, and maybe need few correction,
i want to share my script for rename/move Audio files using Musicbrainz Picard.
for information, an portable is available on portableapps.com, i use it for use it as portable and not lost my setting, because all settings are stored inside windows registry
the convention is :
Code:
Root
--> %AlbumArtist%
| ---> %Year% - %Album% [Extension file]
| ---> %DiscNumber%-%Track% - %Title% [%Artists% featuring without the %AlbumArtist%].ext
or
| ---> %Track% - %Title% [%Artists% featuring]
| ---> %Title%.ext (if music without album or extracted from album)
| ---> %Artists% - %Title%.ext (if music without album or extracted from album and have multi Artists)
--> Various Artists
| ---> %Album% [%ExtensionFile%]
| ---> %Artist% - %Title%.ext
for sorting by albumartist, if the tag is missing you need to add it before save files.
don't forget to remove album / track, if the file is alone or you want it
for the discnumber before title, the tag " %totaldiscs% must be present, only use the %discnumber% will break the convention.
Adapt the code to the Various Artists name from your setting :
$set(_variousartist,Various Artists)
if you see few error during renaming, you can includ for example : XXX1XXX before " %artist% -" for know what line is used for your files.
the code is not perfect, and maybe need few correction,
Code:
$noop( # set variable read for use in script )
$setmulti(multiartists2,%artists%,)
$set(multiartists3,$replace(%multiartists2%,%albumartist%; ,))
$set(multiartists4,$replace(%multiartists3%,;, &))
$set(_variousartist,Various Artists)
$noop( if albumartist is not available, use artist as albumartist)
$if($not(%albumartist%),$set(albumartist,%artist%),)
$noop( check if the %albumartist% name = %artist%, if different it recognize the album as VariousArtist or Compilation)
$if2(%albumartist%,%artist%)
$noop( create an subfolder, only if tag contain album tag, else move it inside the Artist folder )
$if(%album%,
$noop( new subfolder)
/
$noop( if it is an album "artist = albumartist" or "artist = contain "various artist" name" , date is added before the album name)
$if($or($inmulti(%artists%,%albumartist%),$if($eq(%albumartist%,%_variousartist%),,1)),$if2($if(%originaldate%,$left(%originaldate%,4) - ,),$if(%date%,$left(%date%,4) - ,)))
$noop( if Compilation, only use albumname as folder name)
$if($ne(%albumartist%,),%album%)
$noop( add extension file to the album name)
[$upper(%_extension%)]
,)
$noop( new subfolder)
/
$if($and(%album%,%tracknumber%),
$noop( check if the album contain many disc, if yes, the disc number is added before the track number)
$if($gt(%totaldiscs%,1),$num(%discnumber%,1)-,)$if($ne(%albumartist%,),$num(%tracknumber%,2) - ,)
,)
$noop(file name: various artiste : artist name + title track OR Artistalbum + featuring , is keep the title track only as above +"feat. Artist name")
$noop(file name Various artists : Artist - title track ---------------- TESTING LINE XXX1XXX --------------- )
$if($and($and($ne(%artist%,%albumartist%),$ne(%albumartist%,%_variousartist%)),$not($in(%artist%,%albumartist%))),%artist% - ,)
$noop(file name Various Artists : Artist - title track ---------------- TESTING LINE XXX2XXX ---------------)
$if($and($and($ne(%artist%,%albumartist%),$eq(%albumartist%,%_variousartist%)),$not($in(%artist%,%albumartist%))),%artist% - ,)
$noop(file name Various Artist : Artist - title track ---------------- TESTING LINE XXX3XXX ---------------)
$if($and($and(%artists%,$if($in(%artist%,%albumartist%),,1)),$ne(%albumartist%,%_variousartist%)),%artist% - ,)
$noop( mis de coté pour le moment)
$noop(file name Artist album + artists avaiblable + no track number : Artist - title track ---------------- TESTING LINE XXX4XXX ---------------)
$if($and($and($and($not(%tracknumber%),$ne(%artists%,%artist%)),$in(%artist%,%albumartist%)),$ne(%albumartist%,%_variousartist%)),%artist% - ,)
$noop( mis de coté pour le moment)
$noop(file name : title track)
%title%
$noop(file name Album Artist + featuring : title track [feat. xxx] )
$if($if($and($if($and($in(%artist%,%albumartist%),%artists%),1,),$if($eq(%artist%,%albumartist%),,1)),,1),, [feat. %multiartists4%])
Last edited: