Conditional command depending on file type
Posted: 10 Apr 2022, 09:23
I had this command to process MP3/M4A
but then I started using FLAC files and had to change the command to keep the same formatting.
The change was media.PartPosition to media.Part so it took into account the disk number
To filter the files I added and
But I have to run the command twice for each file type, how can I put everything together in one command?
And by the way, if one of the mp3 or m4a files has a bitrate lower than 320kbps how do I include [000] at the end of the filename?
Thanks for the help
Code: Select all
filebot -rename "/input/" -r --output "/output/" --format "{albumArtist0 = albumArtist.sortName().charAt(0); albumArtist0.isDigit() ? '0-9' : albumArtist0}/{music.albumArtist.upperInitial().slash(', ')}/{album.upperInitial().colon(' -')} ({y})/{media.PartPosition!=null ? media.PartPosition+'.' : ''}{pi.pad(2)!=null ? pi.pad(2)+'.' : ''} {t.upperInitial().colon(' -')}" --db ID3
Code: Select all
filebot -rename "/input/" -r --output "/output/" --format "{albumArtist0 = albumArtist.sortName().charAt(0); albumArtist0.isDigit() ? '0-9' : albumArtist0}/{music.albumArtist.upperInitial().slash(', ')}/{album.upperInitial().colon(' -')} ({y})/{media.Part!=null ? media.Part+'.' : ''}{pi.pad(2)!=null ? pi.pad(2)+'.' : ''} {t.upperInitial().colon(' -')}" --db ID3
To filter the files I added
Code: Select all
--file-filter "f =~ /mp3|m4a/"
Code: Select all
--file-filter "f =~ /flac/"
And by the way, if one of the mp3 or m4a files has a bitrate lower than 320kbps how do I include [000] at the end of the filename?
Thanks for the help