Page 1 of 1

Music Naming - {audio.bitratestring} creating additional folder

Posted: 03 Feb 2017, 18:02
by manbearpig2012
Just got word of a problem from a Plex user trying to rename their music. They wanted to include the bitrate in the filename, so used

Code: Select all

Music/{artist}/{album} {y}/{pi.pad(2)} - {t} - [{audio[0].bitratestring}]
Hoping for an output like Music/Buckcherry/Fifteen/07 - Crazy bitch - [249 kbps], but instead, the {audio.bitratestring} in filebot used kb/s, so the output is an extra folder as seen here Image

This would make a file named "s].mp3" put in the "07 - Crazy Bitch - [249 kb" folder.

I was able to find a work around for him, by adding

Code: Select all

.replace('/', 'p')
to the end of bitratestring in the original script, making it

Code: Select all

Music/{artist}/{album} {y}/{pi.pad(2)} - {t} - [{audio[0].bitratestring.replace('/', 'p')}]
making it come out correctly
Image

Just thought i'd bring it you your attention, as the fix isn't obvious to most. Maybe change kb/s to kbps in the audio.bitratestring expression if possible?

Cheers

Re: Music Naming - {audio.bitratestring} creating additional folder

Posted: 03 Feb 2017, 18:34
by rednoah
If you use raw MediaInfo bindings then you'll need to clean the values yourself.

I'd do this:

Code: Select all

{(bitrate/1000).toInteger() + ' kbps'}
I'll add a {kbps} binding for this use case for next release.