Topic: Folder naming - Take over a bit from old name

Hello everyone,

I hope you are willing to assist a scripting noob. I use one of the awesome file naming strings from the repository thread and wanted to modify it for my needs. The string (courtesy of UllicPendragon) I use is:

$replace($if($eq($left($if2(%albumartist%,%artist%),4),The ),$left($right($if2(%albumartist%,%artist%),$sub($len($if2(%albumartist%,%artist%)),4)),1),$left($if2(%albumartist%,%artist%),1))/$rreplace($replace($if2(%albumartist%,%artist%),...,…),\\.\$,$noop(.))/$if(%date%,[$left(%date%,4)] )$rreplace($replace(%album%,...,…),\\.\$,$noop(.))/$num(%tracknumber%,2) - $replace(%title%,...,…),_,$noop(.)))

It results in the files being named like this:
S\SixxA.M\[2007] The Heroin Diaries Soundtrack\03 - Life Is Beautiful.mp3

which is pretty much what I want and I am happy with it. BUT, in a horridly arduous work I manually renamed all folders some time ago, so that I have the bitrate and encoder in the folder name.

Example: Wisp - NRTHNDR [V0, Lame]

Now, is there a way I could keep those endings and implement them in the new file/folder naming structure?

Thank you very much in advance,
Mazuke

P.S.: Also, a minor cosmetical issue: Is there a way to have the year in "normal" round parentheses like "(2010)" instead of "[2010]"?

2

Re: Folder naming - Take over a bit from old name

date part is easy. just replace [$left(%date%,4)] with '('$left(%date%,4)')'

for the other part, I don't think it is currently possible in Picard. all you can get as technical file detail is the extension of the file (%_extension%).

Re: Folder naming - Take over a bit from old name

Please create an account and vote for http://tickets.musicbrainz.org/browse/PICARD-117 though, if you'd like to see it happen :)

4

Re: Folder naming - Take over a bit from old name

but that ticket is only for bitrate.
Encoder applications and even their versions and encoding switches are important for people too.

Re: Folder naming - Take over a bit from old name

Add a comment to the ticket or create a new ticket then?

And while you're at it; document how it's possible to get encoder switches in a standardised way across all tag formats.

6

Re: Folder naming - Take over a bit from old name

c:\test\a1\x\testing.mp3:

file name variables:
%_filename%: holds only the name of the file: testing
%_directory%: holds the full path minus the filename: c:\test\a1\x
%_extension%: holds only the extension of the file: mp3

encoding variables:
%_bitrate%: holds the bitrate or average bitrate of file: ~187 kbps
%_codec%: holds the codec used in file: MPEG Layer III
%_encoding-tool%: LAME 3.98 beta
%_encoding-details%: holds the encoding type and possible options: [Lossy|Lossless|Lossless with Correction File][, CBR|VBR|ABR|etc...][, possible other encoding details which will vary from encoder to encoder]: Lossy, VBR, v0, Joint Stereo

audio variables:
%_channels%: holds the number of channels: 2
%_samplerate%: holds the sample rate of audio: 44100 Hz
%_duration%: duration and maybe total number of samples of the audio: 3:39.320, 9 782 12 samples

I guess these are nice to have technical scripting variables and if I am not mistaken, if not all, most of these can already be read by Mutagen library.

I don't think we need to standardize anything actually, we can start supporting mp3 (lame) encoding options and maybe in the future more can be added more. All in all, the string will be in one variable, only problem is how to read it from file.

Re: Folder naming - Take over a bit from old name

Again, it's more useful to add to (separate) JIRA tickets than it is here.

Picard really isn't in the business of having logic specific to individual encoders from what I know. It's, as much as possible, a standards-based tagger. The others are fine; but I fear %_encoding-details% is unlikely to ever be done unless there is some kind of standard ID3 tag that these are written to; or if Mutagen produces some encoder-independent details similar to this which can be extracted.

Btw, %encodedby% is already available that reads TENC for ID3 for example. No idea if anything uses it though.

8

Re: Folder naming - Take over a bit from old name

TENC is not for this purpose.

TENC
   The 'Encoded by' frame contains the name of the person or
   organisation that encoded the audio file. This field may contain a
   copyright message, if the audio file also is copyrighted by the
   encoder.

Others mostly I agree.