diff --git a/source/net/sourceforge/filebot/cli/CmdlineOperations.java b/source/net/sourceforge/filebot/cli/CmdlineOperations.java index d05e3114..0ce8129e 100644 --- a/source/net/sourceforge/filebot/cli/CmdlineOperations.java +++ b/source/net/sourceforge/filebot/cli/CmdlineOperations.java @@ -157,7 +157,11 @@ public class CmdlineOperations implements CmdlineInterface { for (List batch : batchSets) { // auto-detect series name if not given - Collection seriesNames = (query == null) ? detectQuery(batch, locale, strict) : singleton(query); + Collection seriesNames = (query == null) ? detectQuery(batch, locale) : singleton(query); + + if (strict && seriesNames.size() > 1) { + throw new Exception("Handling multiple shows requires non-strict matching"); + } // fetch episode data Set episodes = fetchEpisodeSet(db, seriesNames, sortOrder, locale, strict); @@ -510,7 +514,7 @@ public class CmdlineOperations implements CmdlineInterface { // lookup subtitles via text search, only perform hash lookup in strict mode if ((query != null || !strict) && !collector.isComplete()) { // auto-detect search query - Collection querySet = (query == null) ? detectQuery(filter(files, VIDEO_FILES), language.toLocale(), false) : singleton(query); + Collection querySet = (query == null) ? detectQuery(filter(files, VIDEO_FILES), language.toLocale()) : singleton(query); for (SubtitleProvider service : WebServices.getSubtitleProviders()) { if (collector.isComplete()) { @@ -665,12 +669,12 @@ public class CmdlineOperations implements CmdlineInterface { } - private List detectQuery(Collection mediaFiles, Locale locale, boolean strict) throws Exception { + private List detectQuery(Collection mediaFiles, Locale locale) throws Exception { // detect series name by common word sequence List names = detectSeriesNames(mediaFiles, locale); - if (names.isEmpty() || (strict && names.size() > 1)) { - throw new Exception("Unable to auto-select query: " + names); + if (names.isEmpty()) { + throw new Exception("Failed to auto-detect query"); } CLILogger.config("Auto-detected query: " + names);