* fix for SNAME.YYYY.SEE style episode naming scheme

@see https://www.filebot.net/forums/viewtopic.php?f=6&t=3045
This commit is contained in:
Reinhard Pointner 2015-10-05 16:53:01 +00:00
parent ea4d49165f
commit b7aff8ec45
1 changed files with 12 additions and 1 deletions

View File

@ -401,7 +401,7 @@ public class MediaDetection {
for (File path : listPathTail(f, 2, true)) {
String fn = getName(path);
// ignore non-strict series name parsing if there are movie year patterns
if (!strict && parseMovieYear(fn).size() > 0) {
if (!strict && parseMovieYear(fn).equals(parseNumbers(fn))) {
break;
}
String sn = seriesNameMatcher.matchByEpisodeIdentifier(fn);
@ -775,6 +775,17 @@ public class MediaDetection {
return years;
}
public static List<Integer> parseNumbers(String name) {
List<Integer> numbers = new ArrayList<Integer>();
for (String it : name.split("\\D+")) {
if (it.length() > 0) {
int n = Integer.parseInt(it);
numbers.add(n);
}
}
return numbers;
}
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()) {