Music Naming - {audio.bitratestring} creating additional folder

All your suggestions, requests and ideas for future development
Post Reply
manbearpig2012
Posts: 10
Joined: 26 Apr 2016, 18:08

Music Naming - {audio.bitratestring} creating additional folder

Post 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
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post 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.
:idea: Please read the FAQ and How to Request Help.
Post Reply