diff --git a/source/net/sourceforge/filebot/cli/CmdlineOperations.java b/source/net/sourceforge/filebot/cli/CmdlineOperations.java index 2d58a1bc..dd6d1eb1 100644 --- a/source/net/sourceforge/filebot/cli/CmdlineOperations.java +++ b/source/net/sourceforge/filebot/cli/CmdlineOperations.java @@ -621,6 +621,7 @@ public class CmdlineOperations implements CmdlineInterface { public List getSubtitles(Collection files, String db, String query, String languageName, String output, String csn, boolean strict) throws Exception { final Language language = getLanguage(languageName); final Pattern databaseFilter = (db != null) ? Pattern.compile(db, Pattern.CASE_INSENSITIVE) : null; + CLILogger.finest(String.format("Get [%s] subtitles for %d files", language.getName(), files.size())); // when rewriting subtitles to target format an encoding must be defined, default to UTF-8 final Charset outputEncoding = (csn != null) ? Charset.forName(csn) : (output != null) ? Charset.forName("UTF-8") : null; @@ -743,7 +744,6 @@ public class CmdlineOperations implements CmdlineInterface { return emptyList(); } - CLILogger.finest(format("Missing subtitles for %d video files", videoFiles.size())); return getSubtitles(videoFiles, db, query, languageName, output, csn, strict); } diff --git a/website/scripts/utorrent-postprocess.groovy b/website/scripts/utorrent-postprocess.groovy index 548b3635..4aeed53b 100644 --- a/website/scripts/utorrent-postprocess.groovy +++ b/website/scripts/utorrent-postprocess.groovy @@ -12,7 +12,7 @@ if (tryQuietly{ ut_state != ut_state_allow }) { } // enable/disable features as specified via --def parameters -def subtitles = tryQuietly{ subtitles.toBoolean() } +def subtitles = tryQuietly{ subtitles.toBoolean() ? ['en'] : subtitles.split(/[ ,|]+/).findAll{ it.length() >= 2 } } def artwork = tryQuietly{ artwork.toBoolean() } def backdrops = tryQuietly{ backdrops.toBoolean() } def clean = tryQuietly{ clean.toBoolean() } @@ -28,7 +28,7 @@ def gmail = tryQuietly{ gmail.split(':', 2) } // series/anime/movie format expressions def format = [ - tvs: tryQuietly{ seriesFormat } ?: '''TV Shows/{n}/{episode.special ? "Special" : "Season "+s}/{n} - {episode.special ? "S00E"+special.pad(2) : s00e00} - {t}''', + tvs: tryQuietly{ seriesFormat } ?: '''TV Shows/{n}/{episode.special ? "Special" : "Season "+s}/{n} - {episode.special ? "S00E"+special.pad(2) : s00e00} - {t}{".$lang"}''', anime: tryQuietly{ animeFormat } ?: '''Anime/{n}/{n} - {sxe} - {t}''', mov: tryQuietly{ movieFormat } ?: '''Movies/{n} ({y})/{n} ({y}){" CD$pi"}{".$lang"}''', music: tryQuietly{ musicFormat } ?: '''Music/{n}/{album}/{n} - {t}''' @@ -148,7 +148,9 @@ groups.each{ group, files -> _log.finest("Group: $group => ${files*.name}") } groups.each{ group, files -> // fetch subtitles if (subtitles) { - files += getMissingSubtitles(file:files, output:"srt", encoding:"utf-8") + subtitles.each{ languageCode -> + files += getMissingSubtitles(file:files, output:'srt', encoding:'UTF-8', lang:languageCode) + } } // EPISODE MODE