* xattr 1st class by default if possible
This commit is contained in:
parent
74341bd123
commit
bff47228c0
|
@ -237,8 +237,22 @@ def detectSeriesName(files, boolean useSeriesIndex = true, boolean useAnimeIndex
|
||||||
}
|
}
|
||||||
|
|
||||||
def detectMovie(File file, strict = true, queryLookupService = TheMovieDB, hashLookupService = OpenSubtitles, locale = Locale.ENGLISH) {
|
def detectMovie(File file, strict = true, queryLookupService = TheMovieDB, hashLookupService = OpenSubtitles, locale = Locale.ENGLISH) {
|
||||||
def movies = MediaDetection.matchMovieName(file.listPath(4, true).findResults{ it.name ?: null }, true, 0) ?: MediaDetection.detectMovie(file, hashLookupService, queryLookupService, locale, strict)
|
// 1. xattr
|
||||||
return movies == null || movies.isEmpty() ? null : movies.toList()[0]
|
def m = tryQuietly{ file.metadata.object as Movie }
|
||||||
|
if (m != null)
|
||||||
|
return m
|
||||||
|
|
||||||
|
// 2. perfect filename match
|
||||||
|
m = MediaDetection.matchMovieName(file.listPath(4, true).findResults{ it.name ?: null }, true, 0)
|
||||||
|
if (m != null && m.size() > 0)
|
||||||
|
return m[0]
|
||||||
|
|
||||||
|
// 3. run full-fledged movie detection
|
||||||
|
m = MediaDetection.detectMovie(file, hashLookupService, queryLookupService, locale, strict)
|
||||||
|
if (m != null && m.size() > 0)
|
||||||
|
return m[0]
|
||||||
|
|
||||||
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
def matchMovie(String filename, strict = true, maxStartIndex = 0) {
|
def matchMovie(String filename, strict = true, maxStartIndex = 0) {
|
||||||
|
|
|
@ -521,7 +521,7 @@ public class MediaDetection {
|
||||||
return seriesList;
|
return seriesList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Collection<Movie> detectMovie(File movieFile, MovieIdentificationService hashLookupService, MovieIdentificationService queryLookupService, Locale locale, boolean strict) throws Exception {
|
public static List<Movie> detectMovie(File movieFile, MovieIdentificationService hashLookupService, MovieIdentificationService queryLookupService, Locale locale, boolean strict) throws Exception {
|
||||||
Set<Movie> options = new LinkedHashSet<Movie>();
|
Set<Movie> options = new LinkedHashSet<Movie>();
|
||||||
|
|
||||||
// try xattr metadata if enabled
|
// try xattr metadata if enabled
|
||||||
|
|
Loading…
Reference in New Issue