Page 1 of 1

Adding Source to Library of Movies

Posted: 04 Jul 2019, 22:17
by shooga
I'm moving from couchpotato to radarr and my library doesn't have the source in the file names. This wasn't useful with CP, but I can see that it is with radarr. I'd like to use filebot to add source based on some basic criteria: if the file size is 8GB or greater then I'll call it a Bluray source, if not, then WEBDL. So I need to figure out the logic to use file size in this way.

It looks like {gigabytes} is a string and I don't see how to convert it to an int for the comparison. Is that possible?

In the meantime, I'm trying to use file.length and have the following expression:

Code: Select all

{n.colon(' - ')} ({y}) {(file.length()/1e9).toFloat().round(1) >= 8 ? 'Bluray-' : 'WEBDL-'}{vf}{subt}
This seems to work, but it adds WEBDL to my .srt files rather than staying consistent with the movie file name. Is there a simple way to avoid that?

Maybe there's a much simpler way to do this... ;)

Thanks!

Re: Adding Source to Library of Movies

Posted: 04 Jul 2019, 22:25
by rednoah
This should work:

Code: Select all

{bitrate > 5e6 ? 'HighBitRate' : 'LowBitRate'}
:idea: {bitrate} will be read from the corresponding video file if any (default behaviour for all MediaInfo bindings)

:idea: 5 MBit/s ➔ large file

Re: Adding Source to Library of Movies

Posted: 04 Jul 2019, 22:31
by kim
convert it to an int for the comparison. Is that possible?

Code: Select all

.toInteger()
but, is not an int so use

Code: Select all

{gigabytes.replace(/,/,'.') as BigDecimal}

Code: Select all

{gigabytes.replace(/,/,'.').toBigDecimal() > 8 ? 'Bluray-' : 'WEBDL-'}
check if isVideo or isSubtitle

Code: Select all

f.isVideo()
or

Code: Select all

f.isSubtitle()

Code: Select all

{gigabytes.replace(/,/,'.').toBigDecimal() > 8 ? 'Bluray-' : f.isVideo() ? 'WEBDL-' : ''}

Code: Select all

{f.isVideo() ? gigabytes.replace(/,/,'.').toBigDecimal() > 8 ? 'Bluray-' : 'WEBDL-' : ''}
btw: if file has the tag just use

Code: Select all

{source}
;)

Re: Adding Source to Library of Movies

Posted: 04 Jul 2019, 22:53
by shooga
Thanks for the help. That seems to work!