Page 1 of 1

If subtitle not found then ...

Posted: 08 Mar 2014, 22:37
by gavdari
Hi,
I've got a script that I run on newly downloaded episodes which should find the subtitle and rename the files accordingly. What I want to do is for the script to quit when no subtitle is found. How should I do that? Currently, I'm using the following to find the subtitles:

Code: Select all

filebot -get-missing-subtitles "$1" --lang en -non-strict

Re: If subtitle not found then ...

Posted: 09 Mar 2014, 05:32
by rednoah
You could try using the Exit Code but I think on Windows it doesn't work properly.

Best bet is a little Groovy script:
http://www.filebot.net/script.html

Pseudo Code:

Code: Select all

subs = getMissingSubtitles()
if subs not empty {
   rename()
}

Re: If subtitle not found then ...

Posted: 09 Mar 2014, 16:55
by gavdari
Thank you for the reply.
I'm running this on linux, actually it's a right click action and I'd like to avoid calling another script as much as possible.

Code: Select all

subs=filebot -get-missing-subtitles 
doesn't work. How should I do it in a shell script?

Re: If subtitle not found then ...

Posted: 09 Mar 2014, 18:59
by rednoah
Then you can probably simply && the two calls:

Code: Select all

Command A && Command B
You can read up on how && works exactly on google.