From 8a748bbe466a16a9324c573c0a698cd2a621fa7f Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Tue, 5 Apr 2016 18:05:57 +0000 Subject: [PATCH] Avoid loosing identifying information (e.g. release group in brackets) --- source/net/filebot/media/MediaDetection.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/net/filebot/media/MediaDetection.java b/source/net/filebot/media/MediaDetection.java index 4fbdd903..23c477ab 100644 --- a/source/net/filebot/media/MediaDetection.java +++ b/source/net/filebot/media/MediaDetection.java @@ -764,8 +764,8 @@ public class MediaDetection { public static String reduceMovieName(String name, boolean strict) throws IOException { Matcher matcher = compile(strict ? "^(.+)[\\[\\(]((?:19|20)\\d{2})[\\]\\)]" : "^(.+?)((?:19|20)\\d{2})").matcher(name); - if (matcher.find()) { - return String.format("%s %s", normalizePunctuation(matcher.group(1)), matcher.group(2)); + if (matcher.find() && parseMovieYear(matcher.group(2)).size() > 0) { + return String.format("%s %s", trimTrailingPunctuation(matcher.group(1)), matcher.group(2)); } return null; }