Page 1 of 1

Non-Zero Exit Codes on --action test

Posted: 12 Oct 2020, 19:10
by laharah
cmd to replicate:

Code: Select all

> filebot -rename --action test The\ Wolf\ Of\ Snow\ Hollow.2020.1080p.WEB-DL.H264.AC3-/ --db TheMovieDB
Rename movies using [TheMovieDB]
Auto-detect movie from context [/pool/Media/Torrents/The Wolf Of Snow Hollow.2020.1080p.WEB-DL.H264.AC3-/The Wolf Of Snow Hollow.2020.1080p.WEB-DL.H264.AC3-EVO.mkv]
[TEST] from [/pool/Media/Torrents/The Wolf Of Snow Hollow.2020.1080p.WEB-DL.H264.AC3-/The Wolf Of Snow Hollow.2020.1080p.WEB-DL.H264.AC3-EVO.mkv] to [/pool/Media/Torrents/The Wolf Of Snow Hollow.2020.1080p.WEB-DL.H264.AC3-/The Wolf of Snow Hollow (2020).mkv]
Processed 1 file

>echo $?
1
The output hasn't changed from 4.9.1 to 4.9.2, however the exit code is now 1 instead of 0. I use the exit code to catch errors before parsing the output on dry-runs for the deluge plugin. I can change the plugin if this is a deliberate change to expected exit codes, but I wanted to make sure it wasn't just a bug.

Re: Non-Zero Exit Codes on --action test

Posted: 12 Oct 2020, 19:43
by rednoah
It'll return 0 success if 1 or more files have been processed successfully. I guess what changed at some point is that --action TEST operations no longer count, which was a problem for some reason I no longer remember, probably related to history and post-processing features needing to be auto-disabled in test mode.

Re: Non-Zero Exit Codes on --action test

Posted: 12 Oct 2020, 19:56
by laharah
no problem, I'll put in a check to ignore exit codes on test runs.

Re: Non-Zero Exit Codes on --action test

Posted: 12 Oct 2020, 20:16
by laharah
Moving forward, is there any sure fire way to tell the difference between a test-run that passes and one that errors out? I know java will sometimes output un-imporant errors into stderr, so I can't use that to check for failure.

Re: Non-Zero Exit Codes on --action test

Posted: 12 Oct 2020, 20:33
by rednoah
Checking for Processed 0 files should do the trick. If it's 1 or more, then it's at least a partial success. If you process many files, then it's possible for some files to work and some files to fail.

Re: Non-Zero Exit Codes on --action test

Posted: 12 Oct 2020, 21:45
by laharah
Thanks, managed to push out an update for it.