diff --git a/source/net/sourceforge/filebot/format/MediaBindingBean.java b/source/net/sourceforge/filebot/format/MediaBindingBean.java index e60d263f..9c208feb 100644 --- a/source/net/sourceforge/filebot/format/MediaBindingBean.java +++ b/source/net/sourceforge/filebot/format/MediaBindingBean.java @@ -8,7 +8,6 @@ import static java.util.regex.Pattern.*; import static net.sourceforge.filebot.MediaTypes.*; import static net.sourceforge.filebot.format.Define.*; import static net.sourceforge.filebot.hash.VerificationUtilities.*; -import static net.sourceforge.tuned.StringUtilities.*; import java.io.File; import java.io.IOException; @@ -111,8 +110,13 @@ public class MediaBindingBean { @Define("imdb") - public Integer getImdbId() { - return getMovie().getImdbId(); + public String getImdbId() { + int imdb = getMovie().getImdbId(); + + if (imdb < 0) + return null; + + return String.format("%07d", imdb); } @@ -254,7 +258,7 @@ public class MediaBindingBean { File inferredMediaFile = getInferredMediaFile(); // pattern matching any release group name enclosed in separators - Pattern groups = compile("(? releaseGroups = new CachedResource(getBundle(getClass().getName()).getString("url.release-groups"), 24 * 60 * 60 * 1000) { + private final CachedResource releaseGroups = new CachedResource(getBundle(getClass().getName()).getString("url.release-groups"), 24 * 60 * 60 * 1000) { @Override - public String[] process(ByteBuffer data) { - return compile("\\s").split(Charset.forName("UTF-8").decode(data)); + public String process(ByteBuffer data) { + return compile("\\s").matcher(Charset.forName("UTF-8").decode(data)).replaceAll("|"); } }; diff --git a/source/net/sourceforge/filebot/ui/panel/rename/BindingDialog.properties b/source/net/sourceforge/filebot/ui/panel/rename/BindingDialog.properties index 64f2bc87..a62719a8 100644 --- a/source/net/sourceforge/filebot/ui/panel/rename/BindingDialog.properties +++ b/source/net/sourceforge/filebot/ui/panel/rename/BindingDialog.properties @@ -2,4 +2,4 @@ parameter.exclude: ^StreamKind|Count$ # preview expressions (keys are tagged so they can be sorted alphabetically) -expressions: n,s,e,t,y,airdate,absolute,special,imdb,episode,movie,vc,ac,cf,vf,af,resolution,source,group,crc32,fn,ext,file,part,pi,pn,media.title,media.durationString,media.overallBitRateString,video.codecID,video.frameRate,video.displayAspectRatioString,video.height,video.scanType,audio.format,audio.bitRateString,audio.language,text.codecInfo,text.language +expressions: n,s,e,t,y,airdate,absolute,special,imdb,episode,movie,vc,ac,cf,vf,af,resolution,source,group,crc32,fn,ext,file,pi,pn,media.title,media.durationString,media.overallBitRateString,video.codecID,video.frameRate,video.displayAspectRatioString,video.height,video.scanType,audio.format,audio.bitRateString,audio.language,text.codecInfo,text.language