Differentiate exec command for movie and for series

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
AnGeL
Posts: 11
Joined: 25 Mar 2014, 23:31

Differentiate exec command for movie and for series

Post by AnGeL »

Hi rednoah, long time has passed from the first time i was here :lol: and hi everyone here on the forum!

My question is simple, and maybe i can get away with an homemade script but maybe someone can shed a light with a more fashionable way to do it:

I'm currently passing as argument a directory on my nas, which filebot scans and order, then it will call "synoindex -a " to add it to my own library on DS Video. After that, a curl request is send to Sickrage, to make it stop searching for that episode.

My solution is this:

Code: Select all

filebot -script fn:amc --output "/volume1/video/" --lang it --action move -non-strict "/volume1/video/da_ordinare/" --def pushover="*******" subtitles=it skipExtract=y artwork=y clean=y music=n "seriesFormat=SERIE TV/{n}/{'Stagione '+s}/{n} {sxe} - {t} {ac}-{vc} {vf}({hd})" "movieFormat=FILM/{n} ({y})/{n} {y} {ac}-{vc} {vf} ({hd})" "exec=synoindex -a \"{file}\";curl 'http://localhost:8083/api/apikeyhere?cmd=show.refresh&tvdbid={info.id}'"
And it works well! Every episode is correctly seen and marked as "downloaded" by sickrage, except when i came to a movie, which obviously fire a curl request too, but the "info.id" is not associated to anything in sickrage and warns me every time.

Is there any way to make filebot stop doing curl request when it's a movie file? Thanks!
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Differentiate exec command for movie and for series

Post by rednoah »

You could replace

Code: Select all

curl
with

Code: Select all

{any{episode; 'curl'}{'echo'}}
so you'll be calling echo instead of curl for non-episode files.
:idea: Please read the FAQ and How to Request Help.
devster
Posts: 417
Joined: 06 Jun 2017, 22:56

Re: Differentiate exec command for movie and for series

Post by devster »

Is there a binding that distinguishes between movie and episode of a series?
Maybe something in {info} or is something like:

Code: Select all

exec="file {file}; {if ( episode ) { 'http host:port/endpoint1' } else if ( movie ) { 'http host:port/endpoint2' }"
I only work in black and sometimes very, very dark grey. (Batman)
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Differentiate exec command for movie and for series

Post by rednoah »

Yes. You're close, but {episode} and friends don't yield null, but throw an Exception when undefined:
viewtopic.php?f=5&t=1895

e.g.

Code: Select all

any{"New Episode: " + episode}{"New Movie: " + movie}

Code: Select all

any{episode; "New Episode"}{movie; "New Movie"}
:idea: Please read the FAQ and How to Request Help.
Post Reply