diff --git a/source/net/sourceforge/filebot/media/MediaDetection.java b/source/net/sourceforge/filebot/media/MediaDetection.java index db4dbe6f..3f846c42 100644 --- a/source/net/sourceforge/filebot/media/MediaDetection.java +++ b/source/net/sourceforge/filebot/media/MediaDetection.java @@ -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()); } } diff --git a/source/net/sourceforge/filebot/similarity/SeriesNameMatcher.java b/source/net/sourceforge/filebot/similarity/SeriesNameMatcher.java index a38373e2..46d045d0 100644 --- a/source/net/sourceforge/filebot/similarity/SeriesNameMatcher.java +++ b/source/net/sourceforge/filebot/similarity/SeriesNameMatcher.java @@ -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;