Help to create a parameter to rename folders


#1

So, I searched a bit in forums and was using the following parameter:

Format Value
Field: _DIRECTORY
Formatstring: %album% '['$if($eql(%_vbr%,'VBR'),VBR %_bitrate%,%_bitrate%),$replace(%_samplerate%,44100,44,48000,48)']'

This parameter rename my folder to the following format:
C:\XXXXXX\Music<Album Name> <[bitrate,edited sample rate]>\

What I want: a parameter that can put the year too and create sub-folders with the numbers of CDs (just if they exist in tags), and also always remove the last 3 digits of the "sample rate", becoming something like this:

C:\XXXXXX\Music<year> - <[bitrate,sample rate without last 3 digits]>\CD 1

Ex's:
C:\XXXXXX\Music\2010 - Extreme Album [320,48]\CD 1
C:\XXXXXX\Music\2010 - Extreme Album [320,48]\CD 2
C:\XXXXXX\Music\2009 - Ultra Album [320,44]
C:\XXXXXX\Music\Super Album [128,22]\

It's possible to do that? I think there's a smarter way to do this than manually...

Thanks in advantage! :laughing: And please, don't mind my poor english.... :unsure:


#2

What if you included the backslash in the formatting action
$if($geql(%discnumber%,1),'\CD %discumber%','')


#3

No, i just get a sub folder called "CD %discnumber%" :frowning:


#4

With _DIRECTORY you can rename the current folder but not create a new one.

Use _FILENAME to create a new folder.

Format Value
Field: _FILENAME
Format string: %_folderpath%$if($geql(%discnumber%,1),CD $num(%discnumber%,1),)%_filename%

(It's important that your one disc albums have no discnumber tag)


Renaming
#5

There are several ways to do this with Mp3tag Scripting Language.

Convert the value of _SAMPLERATE ...
From:
44100
To:
44

$mid(%_samplerate%,1,$sub($len(%_samplerate%),3)) $left(%_samplerate%,$sub($len(%_samplerate%),3)) $replace(%_samplerate%'$',$right(%_samplerate%'$',4),%DUMMY%) $regexp(%_samplerate%,'^(.+?)...$','$1') $replace(%_samplerate%,'32000','32','44100','44','48000','48','96000','96','192000','192') $div(%_samplerate%,1000)

DD.20100918.1932.CEST


#6

There are several forum threads about DISCNUMBER and subfolders and so on.
Generating %DISCNUMBER% Tags
Discnumber Action
Settgin disc qty from folder qty
Automatic Discnumber tag from Directory Structure

DD.20100918.1930.CEST


#7

These have worked for me. Thanks! :laughing:


#8

Just because of curiosity ...
... why did you choose this expression ...
$replace(%_SAMPLERATE%'$',$right(%_SAMPLERATE%'$',4),)

... instead of the simple and effective ...
$div(%_SAMPLERATE%,1000)
???

DD.20100918.2239.CEST


#9

I've just take one randomly... :unsure: