mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-02 08:25:02 -04:00
* defensive programming
This commit is contained in:
parent
6746fc8b26
commit
d3f3d9054d
@ -235,7 +235,7 @@ def detectSeriesName(files, locale = Locale.ENGLISH) {
|
||||
}
|
||||
|
||||
def detectMovie(File file, strict = true, queryLookupService = TheMovieDB, hashLookupService = OpenSubtitles, locale = Locale.ENGLISH) {
|
||||
def movies = MediaDetection.matchMovieName(file.listPath(3, true)*.name, true, 0) ?: MediaDetection.detectMovie(file, hashLookupService, queryLookupService, locale, strict)
|
||||
def movies = MediaDetection.matchMovieName(file.listPath(4, true).findResults{ it.name ?: null }, true, 0) ?: MediaDetection.detectMovie(file, hashLookupService, queryLookupService, locale, strict)
|
||||
return movies == null || movies.isEmpty() ? null : movies.toList()[0]
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user