From c4ba95b24be476dc1356c9c85caead58b08ac94b Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Tue, 15 Apr 2014 12:26:09 +0000 Subject: [PATCH] + new bindings {defines} and {label} for accessing --def options passed via cmdline --- .../filebot/format/MediaBindingBean.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/source/net/sourceforge/filebot/format/MediaBindingBean.java b/source/net/sourceforge/filebot/format/MediaBindingBean.java index 991bb85b..21e159de 100644 --- a/source/net/sourceforge/filebot/format/MediaBindingBean.java +++ b/source/net/sourceforge/filebot/format/MediaBindingBean.java @@ -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 getUserDefinedArguments() throws IOException { + return Settings.getApplicationArguments().defines; + } + + @Define("label") + public String getUserDefinedLabel() throws IOException { + for (Entry it : getUserDefinedArguments().entrySet()) { + if (it.getKey().endsWith("label")) { + return it.getValue(); + } + } + return null; + } + @Define("object") public Object getInfoObject() { return infoObject;