mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-24 16:58:51 -05:00
* easy way for accessing optional --def variables via _def.name
This commit is contained in:
parent
5bf2dc1a0f
commit
4063f57e54
@ -17,6 +17,8 @@ import java.security.Permissions;
|
|||||||
import java.security.PrivilegedActionException;
|
import java.security.PrivilegedActionException;
|
||||||
import java.security.PrivilegedExceptionAction;
|
import java.security.PrivilegedExceptionAction;
|
||||||
import java.security.ProtectionDomain;
|
import java.security.ProtectionDomain;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.PropertyPermission;
|
import java.util.PropertyPermission;
|
||||||
|
|
||||||
@ -132,6 +134,14 @@ class ScriptShell {
|
|||||||
bindings.put("_args", args);
|
bindings.put("_args", args);
|
||||||
bindings.put("_shell", this);
|
bindings.put("_shell", this);
|
||||||
|
|
||||||
|
Map<String, String> defines = new LinkedHashMap<String, String>();
|
||||||
|
if (args.bindings != null) {
|
||||||
|
for (Entry<String, String> it : args.bindings) {
|
||||||
|
defines.put(it.getKey(), it.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bindings.put("_def", defines);
|
||||||
|
|
||||||
bindings.put("_types", MediaTypes.getDefault());
|
bindings.put("_types", MediaTypes.getDefault());
|
||||||
bindings.put("_log", CLILogger);
|
bindings.put("_log", CLILogger);
|
||||||
|
|
||||||
|
@ -188,7 +188,7 @@ if (gmail && !getRenameLog().isEmpty()) {
|
|||||||
|
|
||||||
// send html mail
|
// send html mail
|
||||||
def renameLog = getRenameLog()
|
def renameLog = getRenameLog()
|
||||||
def emailTitle = tryQuietly { ut_title } ?: input*.dir.unique()
|
def emailTitle = tryQuietly { ut_title } ?: input*.dir.name.unique()
|
||||||
|
|
||||||
sendGmail(
|
sendGmail(
|
||||||
subject: "[FileBot] ${emailTitle}",
|
subject: "[FileBot] ${emailTitle}",
|
||||||
|
Loading…
Reference in New Issue
Block a user