From 44d738738a5d98549174ecd3e9032665a85caeb0 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sun, 18 Jan 2015 12:50:24 +0000 Subject: [PATCH] * remove special support for idx/sub pairs because it may not always work as expected when dealing with nested folders --- .../net/filebot/format/MediaBindingBean.java | 28 ------------------- 1 file changed, 28 deletions(-) diff --git a/source/net/filebot/format/MediaBindingBean.java b/source/net/filebot/format/MediaBindingBean.java index c6909571..db806739 100644 --- a/source/net/filebot/format/MediaBindingBean.java +++ b/source/net/filebot/format/MediaBindingBean.java @@ -30,7 +30,6 @@ import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; import java.util.concurrent.TimeUnit; -import java.util.regex.Matcher; import java.util.regex.Pattern; import net.filebot.Cache; @@ -45,7 +44,6 @@ import net.filebot.mediainfo.MediaInfo; import net.filebot.mediainfo.MediaInfo.StreamKind; import net.filebot.similarity.SimilarityComparator; import net.filebot.util.FileUtilities; -import net.filebot.util.FileUtilities.ExtensionFileFilter; import net.filebot.web.AudioTrack; import net.filebot.web.Episode; import net.filebot.web.EpisodeListProvider; @@ -510,17 +508,6 @@ public class MediaBindingBean { return null; } - // exclude VobSub from any normal text-based subtitle processing - if (hasExtension(mediaFile, "idx")) { - return Language.getLanguage(grepLanguageFromSUBIDX(mediaFile)); - } else if (hasExtension(mediaFile, "sub")) { - for (File idx : getChildren(mediaFile.getParentFile(), new ExtensionFileFilter("idx"))) { - if (isDerived(idx, mediaFile)) { - return Language.getLanguage(grepLanguageFromSUBIDX(idx)); - } - } - } - return null; } @@ -970,21 +957,6 @@ public class MediaBindingBean { return hash; } - private Locale grepLanguageFromSUBIDX(File idx) throws IOException { - String text = new String(readFile(idx), "UTF-8"); - - // # English - // id: en, index: 0 - Pattern pattern = Pattern.compile("^id: (\\w+), index: (\\d+)", Pattern.MULTILINE); - Matcher matcher = pattern.matcher(text); - - if (matcher.find()) { - return new Locale(matcher.group(1)); - } else { - return null; - } - } - private String getOriginalFileName(File file) { try { return new MetaAttributes(file).getOriginalName();