Is there a way I can get minimum/maximum values from numeric fields, such as %_bitrate%
, from a list of files ($loop
)?
Specifically, I'm looking to create an output like
Bitrate: 800-1500 kbps
For a list of files with values like
Track 1: Bitrate: 900 kbps
Track 2: Bitrate: 800 kbps
Track 3: Bitrate: 1200 kbps
Track 4: Bitrate: 1500 kbps
Track 5: Bitrate: 1000 kbps
Is there a way to do this?
The search words "minimum maximum export" get this hit:
Hello, apologies if this is posted somewhere, I was unable to find it.
When cataloguing my audiobooks, I have Tag-Filename set up as:
Artist - Series # - Title (Genre) (Bit Rate) (Format)
But some (many) have varying bit-rates between files. So for example:
J.K. Rowling - Harry Potter 01 - Harry Potter and the Philosopher's Stone (Fantasy) (48k) (MP3)
J.K. Rowling - Harry Potter 01 - Harry Potter and the Philosopher's Stone (Fantasy) (64k) (MP3)
J.K. Rowling - Harry Potter 01 - Harry Pot…
So sorry, I missed that!
Thank you
FWIW, here is the line that compares, sets and outputs the min/max for the %_bitrate%
field, using variables called brMin
and brMax
for intermediate values.
Replace those with what you're after if you're looking to do something similar
$loop(%File%)$loop(%File%)$puts(brMin,$if($or($less(%_bitrate%,$get(brMin)),$less($get(brMin),1)),%_bitrate%,$get(brMin)))$puts(brMax,$if($or($grtr(%_bitrate%,$get(brMax)),$less($get(brMax),1)),%_bitrate%,$get(brMax)))$loopend()$get(brMin)-$get(brMax)$loopend() kbps
This will render
800-1500 kbps
for the above example scenario.
Thank you to @rko31415 , that looks like a nightmare to set up