Exit on warning

Any questions? Need some help?
Post Reply
Timbo925
Posts: 6
Joined: 19 Feb 2015, 23:12

Exit on warning

Post by Timbo925 »

Hi,
I was wondering if their is a way to stop the renaming/copy process of filebot when a warning is detected?
I run a script on my synology every hour and for some reason sometimes, the following error arises.

Code: Select all

WARNING: Unable to read media info: Unable to load 32-bit native library 'mediainfo' [XXX.mkv]
This will result in duplication in my folders because some media info won't be present in the title.
Can I require the mediainfo library to be present before doing any matching/renaming, preferably using the CLI interface so I don't have to change up my script to much.

Code: Select all

filebot.sh -script fn:amc --output /volume1/NetBackup/FilebotOutput --log-file amc.log --log info --action copy --conflict auto -non-strict /rsync --def  "seriesFormat=/Media/Series/{n}/{n.upperInitial().space('.').replaceAll(/[,]+/)}.{s00e00}.{t.upperInitial().space('.').replaceAll(/[,]+/)}{'.'+vf.match(/720[pP]|1080[pP]/)}{\".\$source\"}{\".\$vc\"}" "movieFormat=/Media/Movies/{n} ({y}){'['+source+']'}/{n.space('.')}.{y}{'.'+fn.match(/3D/)}{'.'+vf}{'.'+ac}{'.'+af}{'.'+lang}{'.CD'+pi}"
Or can I maybe make something required in the series/movieFormat, this way it will fail if I want use some of the medialib info.

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

Re: Exit on warning

Post by rednoah »

Does it fail for specific files? Or does it fail on load and then doesn't work for the whole process?

You can do filebot -script fn:sysinfo to check if libmediainfo is working.

There's nothing you can do in the format, since the format code is not allowed to interfere with the rest of the program. The only option you have to do exactly what you want is to modify the amc script and first check mediainfo for a specific file and ignore it if it's not available.
:idea: Please read the FAQ and How to Request Help.
Timbo925
Posts: 6
Joined: 19 Feb 2015, 23:12

Re: Exit on warning

Post by Timbo925 »

It fails on the all files of the run of the script. The sysinfo tells libmediainfo is detected so it is some of occasional fail to load the library.
I'll have a look at editing the amc script, I'll update if I find the solution.
Timbo925
Posts: 6
Joined: 19 Feb 2015, 23:12

Re: Exit on warning

Post by Timbo925 »

Edited the goovy script and seems to be working, now the script will exit if it is unable to gather the {vc} of a file from the input string

Start script with

Code: Select all

 --def checkLibMediaInfo =y
Add at the top of script

Code: Select all

def checkLibMediaInfo  = tryQuietly{checkLibMediaInfo .toBoolean()}
Below input at line 248, add this

Code: Select all

if (checkLibMediaInfo) {
	def template = '{vc}'
	(getMediaInfo(file:input[0], format:template)) ?: die("LibMediaInfo not initialized")
}
Post Reply