From 41264f00453f419355bed1d87052e6d7738f3ba9 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Fri, 12 Apr 2013 20:36:54 +0000 Subject: [PATCH] * grab series name from folder in obvious cases of folder-per-episode naming schemes @see http://forum.xbmc.org/showthread.php?tid=110302&pid=1393844#pid1393844 --- .../sourceforge/filebot/media/MediaDetection.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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) {