diff --git a/source/net/filebot/media/MediaDetection.java b/source/net/filebot/media/MediaDetection.java index cb712a58..ed2d384c 100644 --- a/source/net/filebot/media/MediaDetection.java +++ b/source/net/filebot/media/MediaDetection.java @@ -394,6 +394,15 @@ public class MediaDetection { for (File path : listPathTail(f, 2, true)) { String sn = seriesNameMatcher.matchByEpisodeIdentifier(getName(path)); if (sn != null && sn.length() > 0) { + // try simplification by separator (for name - title naming style) + if (!strict) { + String snbs = seriesNameMatcher.matchBySeparator(getName(path)); + if (snbs != null && snbs.length() > 0) { + if (snbs.length() < sn.length()) { + sn = snbs; + } + } + } matches.add(sn); break; } diff --git a/source/net/filebot/similarity/SeriesNameMatcher.java b/source/net/filebot/similarity/SeriesNameMatcher.java index 7e192612..b35beb6a 100644 --- a/source/net/filebot/similarity/SeriesNameMatcher.java +++ b/source/net/filebot/similarity/SeriesNameMatcher.java @@ -204,6 +204,17 @@ public class SeriesNameMatcher { return null; } + public String matchBySeparator(String name) { + Pattern separator = Pattern.compile("[\\s]+[-]+[\\s]+"); + + Matcher matcher = separator.matcher(name); + if (matcher.find() && matcher.start() > 0) { + return normalizePunctuation(name.substring(0, matcher.start())); + } + + return null; + } + /** * Try to match a series name from the first common word sequence. *