diff --git a/source/net/filebot/similarity/EpisodeMetrics.java b/source/net/filebot/similarity/EpisodeMetrics.java index 8736f2fc..66183cc8 100644 --- a/source/net/filebot/similarity/EpisodeMetrics.java +++ b/source/net/filebot/similarity/EpisodeMetrics.java @@ -28,7 +28,6 @@ import java.util.regex.Pattern; import net.filebot.WebServices; import net.filebot.media.MediaDetection; -import net.filebot.media.ReleaseInfo; import net.filebot.media.SmartSeasonEpisodeMatcher; import net.filebot.similarity.SeasonEpisodeMatcher.SxE; import net.filebot.vfs.FileInfo; @@ -309,7 +308,6 @@ public enum EpisodeMetrics implements SimilarityMetric { // Match by generic name similarity (absolute) SeriesName(new NameSimilarityMetric() { - private ReleaseInfo releaseInfo = new ReleaseInfo(); private SeriesNameMatcher seriesNameMatcher = new SeriesNameMatcher(Locale.ROOT, false); @Override @@ -351,22 +349,32 @@ public enum EpisodeMetrics implements SimilarityMetric { if (object instanceof Episode) { names = ((Episode) object).getSeries().getEffectiveNames(); } else if (object instanceof File) { + File file = (File) object; + + // check direct mappings first + try { + List directMapping = MediaDetection.matchSeriesByDirectMapping(singleton(file)); + if (directMapping.size() > 0) { + return directMapping; + } + } catch (Exception e) { + Logger.getLogger(EpisodeMetrics.class.getName()).log(Level.WARNING, e.getMessage()); + } + + // guess potential series names from path names = new ArrayList(3); - for (File f : listPathTail((File) object, 3, true)) { + + for (File f : listPathTail(file, 3, true)) { String fn = getName(f); String sn = seriesNameMatcher.matchByEpisodeIdentifier(fn); - if (sn != null) { - names.add(sn); - } else { - names.add(fn); - } + names.add(sn != null ? sn : fn); } } // equally strip away strip potential any clutter if (names != null) { try { - return releaseInfo.cleanRelease(names, false); + return MediaDetection.releaseInfo.cleanRelease(names, false); } catch (NoSuchElementException e) { // keep default value in case all tokens are stripped away } catch (IOException e) { diff --git a/website/data/query-blacklist.txt b/website/data/query-blacklist.txt index 73a1733e..b317d40a 100644 --- a/website/data/query-blacklist.txt +++ b/website/data/query-blacklist.txt @@ -181,6 +181,8 @@ ^TV.Series$ ^TV.Show$ ^TV.Shows$ +^tvp +^tvs ^Uncompleted.Downloads$ ^unsorted$ ^user$ diff --git a/website/data/series-mappings.txt b/website/data/series-mappings.txt index f1a36db4..b1b814a0 100644 --- a/website/data/series-mappings.txt +++ b/website/data/series-mappings.txt @@ -11,9 +11,12 @@ law.and.order.svu Law & Order: Special Victims Unit M.A.S.H M*A*S*H MASH M*A*S*H NCIS.LA NCIS: Los Angeles +poid Person of Interest SuiG7p Suits TBBT The Big Bang Theory -tvs.got Game of Thrones +tv..got Game of Thrones +tv..poi Person of Interest +tv..shield Marvel's Agents of S.H.I.E.L.D. TWD The Walking Dead UndG7p Underemployed wsop World Series of Poker \ No newline at end of file