mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-04 08:25:03 -05:00
* exclude VobSub from normal {lang} binding processing
This commit is contained in:
parent
e631641a0c
commit
823effbe40
@ -42,6 +42,7 @@ import net.sourceforge.filebot.web.MoviePart;
|
||||
import net.sourceforge.filebot.web.MultiEpisode;
|
||||
import net.sourceforge.filebot.web.SortOrder;
|
||||
import net.sourceforge.tuned.FileUtilities;
|
||||
import net.sourceforge.tuned.FileUtilities.ExtensionFileFilter;
|
||||
|
||||
|
||||
public class MediaBindingBean {
|
||||
@ -417,9 +418,22 @@ public class MediaBindingBean {
|
||||
return new Locale(languageSuffix.getISO3Language()); // force ISO3 letter-code
|
||||
|
||||
// require subtitle file
|
||||
if (!SUBTITLE_FILES.accept(mediaFile))
|
||||
if (!SUBTITLE_FILES.accept(mediaFile)) {
|
||||
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));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user