diff --git a/source/net/filebot/media/ReleaseInfo.java b/source/net/filebot/media/ReleaseInfo.java index d49c7bb4..573f4279 100644 --- a/source/net/filebot/media/ReleaseInfo.java +++ b/source/net/filebot/media/ReleaseInfo.java @@ -120,8 +120,12 @@ public class ReleaseInfo { if (languageTag == null) { languageTag = getSubtitleLanguageTagPattern(getDefaultLanguageMap().keySet()); } + String lang = matchLast(languageTag, null, name); - return lang == null ? null : getDefaultLanguageMap().get(lang); + if (lang != null) { + return getDefaultLanguageMap().get(lang); + } + return null; } private Pattern categoryTag; diff --git a/source/net/filebot/subtitle/SubtitleUtilities.java b/source/net/filebot/subtitle/SubtitleUtilities.java index a0c88972..f08b480f 100644 --- a/source/net/filebot/subtitle/SubtitleUtilities.java +++ b/source/net/filebot/subtitle/SubtitleUtilities.java @@ -444,6 +444,12 @@ public final class SubtitleUtilities { return Language.getLanguage(languageTag); } + // check if file name matches a language name (e.g. English.srt) + Language languageName = Language.findLanguage(getName(file)); + if (languageName != null) { + return languageName; + } + // detect language from subtitle text content MemoryFile data = new MemoryFile(file.getName(), ByteBuffer.wrap(readFile(file))); List options = detectSubtitleLanguage(data);