[FEATURE] AMC script test action

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

[FEATURE] AMC script test action

Post by devster » 29 Jan 2018, 21:23

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: 14145
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [FEATURE] AMC script test action

Post by rednoah » 30 Jan 2018, 11:10

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.

User avatar
devster
Posts: 148
Joined: 06 Jun 2017, 22:56

Re: [FEATURE] AMC script test action

Post by devster » 30 Jan 2018, 14:29

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: 14145
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [FEATURE] AMC script test action

Post by rednoah » 30 Jan 2018, 17:13

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.

User avatar
devster
Posts: 148
Joined: 06 Jun 2017, 22:56

Re: [FEATURE] AMC script test action

Post by devster » 30 Jan 2018, 19:14

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

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests