From 0fa092b7ef66201615d89153db22306aac351dd7 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sun, 20 Nov 2011 18:52:57 +0000 Subject: [PATCH] * allow renaming of single subtitles --- .../sourceforge/filebot/cli/CmdlineOperations.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/source/net/sourceforge/filebot/cli/CmdlineOperations.java b/source/net/sourceforge/filebot/cli/CmdlineOperations.java index 30f0f408..a3393382 100644 --- a/source/net/sourceforge/filebot/cli/CmdlineOperations.java +++ b/source/net/sourceforge/filebot/cli/CmdlineOperations.java @@ -71,10 +71,9 @@ public class CmdlineOperations implements CmdlineInterface { ExpressionFormat format = (expression != null) ? new ExpressionFormat(expression) : null; Locale locale = getLanguage(languageName).toLocale(); - List videoFiles = filter(files, VIDEO_FILES); - - if (videoFiles.isEmpty()) { - throw new IllegalArgumentException("No video files: " + files); + List mediaFiles = filter(files, VIDEO_FILES, SUBTITLE_FILES); + if (mediaFiles.isEmpty()) { + throw new IllegalArgumentException("No media files: " + files); } if (getEpisodeListProvider(db) != null) { @@ -90,12 +89,12 @@ public class CmdlineOperations implements CmdlineInterface { // auto-determine mode int sxe = 0; // SxE int cws = 0; // common word sequence - double max = videoFiles.size(); + double max = mediaFiles.size(); SeriesNameMatcher matcher = new SeriesNameMatcher(); - String[] cwsList = (max >= 5) ? matcher.matchAll(videoFiles.toArray(new File[0])).toArray(new String[0]) : new String[0]; + String[] cwsList = (max >= 5) ? matcher.matchAll(mediaFiles.toArray(new File[0])).toArray(new String[0]) : new String[0]; - for (File f : videoFiles) { + for (File f : mediaFiles) { // count SxE matches if (matcher.matchBySeasonEpisodePattern(f.getName()) != null) { sxe++;