1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-24 16:58:51 -05:00

+ new bindings {defines} and {label} for accessing --def options passed via cmdline

This commit is contained in:
Reinhard Pointner 2014-04-15 12:26:09 +00:00
parent 1a730c3ec6
commit c4ba95b24b

View File

@ -30,6 +30,7 @@ import java.util.regex.Pattern;
import net.sourceforge.filebot.Cache;
import net.sourceforge.filebot.Language;
import net.sourceforge.filebot.MediaTypes;
import net.sourceforge.filebot.Settings;
import net.sourceforge.filebot.WebServices;
import net.sourceforge.filebot.hash.HashType;
import net.sourceforge.filebot.media.MetaAttributes;
@ -697,6 +698,21 @@ public class MediaBindingBean {
return System.currentTimeMillis();
}
@Define("defines")
public Map<String, String> getUserDefinedArguments() throws IOException {
return Settings.getApplicationArguments().defines;
}
@Define("label")
public String getUserDefinedLabel() throws IOException {
for (Entry<String, String> it : getUserDefinedArguments().entrySet()) {
if (it.getKey().endsWith("label")) {
return it.getValue();
}
}
return null;
}
@Define("object")
public Object getInfoObject() {
return infoObject;