* exclude VobSub from normal {lang} binding processing

This commit is contained in:
Reinhard Pointner 2013-02-01 18:06:18 +00:00
parent e631641a0c
commit 823effbe40
1 changed files with 15 additions and 1 deletions

View File

@ -42,6 +42,7 @@ import net.sourceforge.filebot.web.MoviePart;
import net.sourceforge.filebot.web.MultiEpisode; import net.sourceforge.filebot.web.MultiEpisode;
import net.sourceforge.filebot.web.SortOrder; import net.sourceforge.filebot.web.SortOrder;
import net.sourceforge.tuned.FileUtilities; import net.sourceforge.tuned.FileUtilities;
import net.sourceforge.tuned.FileUtilities.ExtensionFileFilter;
public class MediaBindingBean { public class MediaBindingBean {
@ -417,9 +418,22 @@ public class MediaBindingBean {
return new Locale(languageSuffix.getISO3Language()); // force ISO3 letter-code return new Locale(languageSuffix.getISO3Language()); // force ISO3 letter-code
// require subtitle file // require subtitle file
if (!SUBTITLE_FILES.accept(mediaFile)) if (!SUBTITLE_FILES.accept(mediaFile)) {
return null; return null;
}
// exclude VobSub from any normal text-based subtitle processing
if (hasExtension(mediaFile, "idx")) {
return null;
} else if (hasExtension(mediaFile, "sub")) {
for (File idx : mediaFile.getParentFile().listFiles(new ExtensionFileFilter("idx"))) {
if (isDerived(idx, mediaFile)) {
return null;
}
}
}
// try statistical language detection
return WebServices.OpenSubtitles.detectLanguage(readFile(mediaFile)); return WebServices.OpenSubtitles.detectLanguage(readFile(mediaFile));
} }