[FEATURE] AMC script test action

All your suggestions, requests and ideas for future development
Post Reply
devster
Posts: 417
Joined: 06 Jun 2017, 22:56

[FEATURE] AMC script test action

Post by devster »

I might be missing a step, but the way I'm currently launching the command whenever I execute the AMC script with --action test the exec command is still executed, which leads to a bunch of errors since the file doesn't actually exist.

Code: Select all

/usr/local/bin/filebot -script fn:amc --action test --output /out --conflict skip -non-strict --log-file amc.log --def artwork=y --def ut_dir=/dir ut_kind=multi ut_title=title ut_label=N/A --def 'exec=/path/to/post-script.sh {quote file} {quote f.dir.dir} {info.database} {info.id} {quote info.name}' --def [email protected] --def [email protected] --def [email protected]
Is it possible to add this check in the script and skip the execution of the command?
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: [FEATURE] AMC script test action

Post by rednoah »

No, but you can do that check in your post-script.sh script:
https://stackoverflow.com/questions/638 ... st-in-bash
:idea: Please read the FAQ and How to Request Help.
devster
Posts: 417
Joined: 06 Jun 2017, 22:56

Re: [FEATURE] AMC script test action

Post by devster »

So would a change such as the following to amc.groovy:

Code: Select all

if ('TEST'.equalsIgnoreCase(_args.action)) {
	exec = false
} else {
	exec = tryQuietly{ exec.toString() }
}
be a bad idea?
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: [FEATURE] AMC script test action

Post by rednoah »

Yes, because you'd make testing of --def exec expressions impossible. Note that --def exec can be used for absolutely any kind of command-line call, which may be just printing extra information via echo, writing extra logs about processed files somewhere, making web requests to some API via curl, etc.
:idea: Please read the FAQ and How to Request Help.
devster
Posts: 417
Joined: 06 Jun 2017, 22:56

Re: [FEATURE] AMC script test action

Post by devster »

Ok, now I see the issue, thank you.
I only work in black and sometimes very, very dark grey. (Batman)
Post Reply