From 1e583d46fe2ce70142a2242c994cd184521599cb Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Tue, 27 Mar 2012 15:26:00 +0000 Subject: [PATCH] * fetch missing subtitles for language --- source/net/sourceforge/filebot/cli/CmdlineOperations.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/net/sourceforge/filebot/cli/CmdlineOperations.java b/source/net/sourceforge/filebot/cli/CmdlineOperations.java index 36c11f51..d38677cb 100644 --- a/source/net/sourceforge/filebot/cli/CmdlineOperations.java +++ b/source/net/sourceforge/filebot/cli/CmdlineOperations.java @@ -595,12 +595,15 @@ public class CmdlineOperations implements CmdlineInterface { } - public List getMissingSubtitles(Collection files, String query, String languageName, String output, String csn, boolean strict) throws Exception { + public List getMissingSubtitles(Collection files, String query, final String languageName, String output, String csn, boolean strict) throws Exception { List videoFiles = filter(filter(files, VIDEO_FILES), new FileFilter() { // save time on repeating filesystem calls private final Map cache = new HashMap(); + // get language code suffix for given language (.eng) + private final String languageCodeSuffix = "." + Language.getISO3LanguageCodeByName(getLanguage(languageName).getName()); + @Override public boolean accept(File video) { @@ -611,7 +614,7 @@ public class CmdlineOperations implements CmdlineInterface { } for (File subtitle : subtitlesByFolder) { - if (isDerived(subtitle, video)) + if (isDerived(subtitle, video) && (subtitle.getName().contains(languageCodeSuffix))) return false; }