From 4c6a9a4856b66748ee4d777b56c57f3843597957 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Mon, 20 Feb 2012 05:53:36 +0000 Subject: [PATCH] * fixfix --- source/net/sourceforge/filebot/cli/CmdlineOperations.java | 2 +- source/net/sourceforge/filebot/cli/ScriptShell.lib.groovy | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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] }