Make sure that OMDb xattr movie data (with imdbid but without tmdbid) doesn't get accepted when processing files with TMDb.

@see https://www.filebot.net/forums/viewtopic.php?f=6&t=4038#p22634
This commit is contained in:
Reinhard Pointner 2016-08-09 16:08:18 +08:00
parent 65d5453797
commit 3ed3f92b48
2 changed files with 15 additions and 10 deletions

View File

@ -699,16 +699,15 @@ public class MediaDetection {
}
public static Movie getLocalizedMovie(MovieIdentificationService service, Movie movie, Locale locale) throws Exception {
// retrieve language-specific movie object if possible
try {
Movie localized = service.getMovieDescriptor(movie, locale);
if (localized != null) {
return localized;
// retrieve language and service specific movie object
if (movie != null) {
try {
return service.getMovieDescriptor(movie, locale);
} catch (Exception e) {
debug.log(Level.WARNING, "Failed to retrieve localized movie data", e);
}
} catch (Exception e) {
debug.log(Level.WARNING, "Failed to retrieve localized movie data", e);
}
return movie;
return null;
}
public static SimilarityMetric getSeriesMatchMetric() {

View File

@ -183,8 +183,10 @@ class MovieMatcher implements AutoCompleteMatcher {
Movie movie = grabMovieName(file, options, strict, locale, autodetect, parent);
// make sure to use language-specific movie object if possible
movie = getLocalizedMovie(service, movie, locale);
if (movie != null) {
movieByFile.put(file, getLocalizedMovie(service, movie, locale));
movieByFile.put(file, movie);
}
}
}
@ -415,7 +417,11 @@ class MovieMatcher implements AutoCompleteMatcher {
if (input != null && input.length() > 0) {
for (Movie movie : detectMovie(new File(input), service, locale, false)) {
// make sure to use language-specific movie object if possible
matches.add(new Match<File, Movie>(null, getLocalizedMovie(service, movie, locale)));
movie = getLocalizedMovie(service, movie, locale);
if (movie != null) {
matches.add(new Match<File, Movie>(null, movie));
}
}
}
return matches;