diff --git a/source/net/sourceforge/filebot/media/MediaDetection.java b/source/net/sourceforge/filebot/media/MediaDetection.java index 3de6b311..b31b97da 100644 --- a/source/net/sourceforge/filebot/media/MediaDetection.java +++ b/source/net/sourceforge/filebot/media/MediaDetection.java @@ -327,7 +327,20 @@ public class MediaDetection { } // match common word sequence and clean detected word sequence from unwanted elements - Collection matches = new SeriesNameMatcher(locale).matchAll(files.toArray(new File[files.size()])); + Collection matches = new LinkedHashSet(); + + // check CWS matches + SeriesNameMatcher snm = new SeriesNameMatcher(locale); + matches.addAll(snm.matchAll(files.toArray(new File[files.size()]))); + + // check for known pattern matches + for (File f : files) { + String sn = snm.matchByEpisodeIdentifier(getName(f.getParentFile())); + if (sn != null) { + matches.add(sn); + } + } + try { matches = stripReleaseInfo(matches, true); } catch (Exception e) {