diff --git a/source/net/sourceforge/filebot/cli/CmdlineOperations.java b/source/net/sourceforge/filebot/cli/CmdlineOperations.java index 1509e0a0..746cb7be 100644 --- a/source/net/sourceforge/filebot/cli/CmdlineOperations.java +++ b/source/net/sourceforge/filebot/cli/CmdlineOperations.java @@ -705,7 +705,7 @@ public class CmdlineOperations implements CmdlineInterface { List probableMatches = findProbableMatches(query, searchResults, strict); if (probableMatches.isEmpty() || (strict && probableMatches.size() != 1)) { - throw new Exception("Failed to auto-select search result: " + probableMatches); + throw new Exception("Failed to auto-select search result: " + searchResults); } // return first and only value diff --git a/source/net/sourceforge/filebot/cli/ScriptShell.lib.groovy b/source/net/sourceforge/filebot/cli/ScriptShell.lib.groovy index 090d8b89..b20f478a 100644 --- a/source/net/sourceforge/filebot/cli/ScriptShell.lib.groovy +++ b/source/net/sourceforge/filebot/cli/ScriptShell.lib.groovy @@ -157,15 +157,15 @@ def parseEpisodeNumber(path, strict = true) { } def parseDate(path) { - return new DateMetric().parse(input) + return new DateMetric().parse(path) } def detectSeriesName(files, locale = Locale.ENGLISH) { - def names = MediaDetection.detectSeriesNames(files.findAll { it.isVideo() || it.isSubtitle() }, locale) + def names = MediaDetection.detectSeriesNames(files instanceof Collection ? files : [new File(files.toString())], locale) return names == null || names.isEmpty() ? null : names.toList()[0] } -def detectMovie(movieFile, locale = Locale.ENGLISH, strict = true) { +def detectMovie(movieFile, strict = true, locale = Locale.ENGLISH) { def movies = MediaDetection.detectMovie(movieFile, OpenSubtitles, TheMovieDB, locale, strict) return movies == null || movies.isEmpty() ? null : movies.toList()[0] }