* improve series detection, and make sure to not scrub things too aggressively as not to loose information

* skip search if all files are tagged already
This commit is contained in:
Reinhard Pointner 2014-04-13 19:42:41 +00:00
parent db86aa5153
commit 9aa97268c5
2 changed files with 9 additions and 4 deletions

View File

@ -305,6 +305,11 @@ public class MediaDetection {
}
}
// completely trust xattr metadata if all files are tagged
if (names.size() == files.size()) {
return getUniqueQuerySet(names);
}
// try to detect series name via nfo files
try {
for (SearchResult it : lookupSeriesNameByInfoFile(files, locale)) {
@ -338,7 +343,7 @@ public class MediaDetection {
fn = sn;
}
(i == 0 ? filenames : folders).add(normalizeBrackets(fn));
(i == 0 ? filenames : folders).add(fn); // keep series name unique with year
}
}
@ -1364,7 +1369,7 @@ public class MediaDetection {
} else if (model instanceof Movie) {
Movie movie = (Movie) model;
if (movie.getYear() > 0 && movie.getTmdbId() > 0) {
Date releaseDate = WebServices.TMDb.getMovieInfo(movie, Locale.ENGLISH, false).getReleased();
Date releaseDate = WebServices.TheMovieDB.getMovieInfo(movie, Locale.ENGLISH, false).getReleased();
xattr.setCreationDate(releaseDate.getTimeStamp());
}
}

View File

@ -192,13 +192,13 @@ public class SeriesNameMatcher {
int seasonEpisodePosition = seasonEpisodeMatcher.find(name, 0);
if (seasonEpisodePosition > 0) {
// series name ends at the first season episode pattern
return normalize(name.substring(0, seasonEpisodePosition));
return name.substring(0, seasonEpisodePosition).trim();
}
int datePosition = dateMatcher.find(name, 0);
if (datePosition > 0) {
// series name ends at the first season episode pattern
return normalize(name.substring(0, datePosition));
return name.substring(0, datePosition).trim();
}
return null;