Page 1 of 1

Differentiate exec command for movie and for series

Posted: 19 Nov 2017, 16:20
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!

Re: Differentiate exec command for movie and for series

Posted: 19 Nov 2017, 17:01
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.

Re: Differentiate exec command for movie and for series

Posted: 23 Nov 2017, 19:53
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' }"

Re: Differentiate exec command for movie and for series

Posted: 23 Nov 2017, 21:50
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"}