Adding Source to Library of Movies

Any questions? Need some help?
Post Reply
shooga
Posts: 2
Joined: 04 Jul 2019, 22:01

Adding Source to Library of Movies

Post by shooga » 04 Jul 2019, 22:17

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!

User avatar
rednoah
The Source
Posts: 16592
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Adding Source to Library of Movies

Post by rednoah » 04 Jul 2019, 22:25

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

kim
Power User
Posts: 802
Joined: 15 May 2014, 16:17

Re: Adding Source to Library of Movies

Post by kim » 04 Jul 2019, 22:31

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}
;)

shooga
Posts: 2
Joined: 04 Jul 2019, 22:01

Re: Adding Source to Library of Movies

Post by shooga » 04 Jul 2019, 22:53

Thanks for the help. That seems to work!

Post Reply