1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-24 08:48:51 -05:00
This commit is contained in:
Reinhard Pointner 2012-02-20 05:53:36 +00:00
parent 859fba6f1b
commit 4c6a9a4856
2 changed files with 4 additions and 4 deletions

View File

@ -705,7 +705,7 @@ public class CmdlineOperations implements CmdlineInterface {
List<SearchResult> probableMatches = findProbableMatches(query, searchResults, strict); List<SearchResult> probableMatches = findProbableMatches(query, searchResults, strict);
if (probableMatches.isEmpty() || (strict && probableMatches.size() != 1)) { 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 // return first and only value

View File

@ -157,15 +157,15 @@ def parseEpisodeNumber(path, strict = true) {
} }
def parseDate(path) { def parseDate(path) {
return new DateMetric().parse(input) return new DateMetric().parse(path)
} }
def detectSeriesName(files, locale = Locale.ENGLISH) { 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] 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) def movies = MediaDetection.detectMovie(movieFile, OpenSubtitles, TheMovieDB, locale, strict)
return movies == null || movies.isEmpty() ? null : movies.toList()[0] return movies == null || movies.isEmpty() ? null : movies.toList()[0]
} }