1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-11-16 14:25:02 -05:00

* avoid false positives in series name detection

This commit is contained in:
Reinhard Pointner 2014-09-13 18:28:03 +00:00
parent 3bde0c1ae9
commit 5624afb010

View File

@ -393,14 +393,19 @@ public class MediaDetection {
if (matches.isEmpty()) { if (matches.isEmpty()) {
for (File f : files) { for (File f : files) {
for (File path : listPathTail(f, 2, true)) { for (File path : listPathTail(f, 2, true)) {
String sn = seriesNameMatcher.matchByEpisodeIdentifier(getName(path)); String fn = getName(path);
// ignore non-strict series name parsing if there are movie year patterns
if (!strict && parseMovieYear(fn).size() > 0) {
break;
}
String sn = seriesNameMatcher.matchByEpisodeIdentifier(fn);
if (sn != null && sn.length() > 0) { if (sn != null && sn.length() > 0) {
// try simplification by separator (for name - title naming style) // try simplification by separator (for name - title naming style)
if (!strict) { if (!strict) {
String snbs = seriesNameMatcher.matchBySeparator(getName(path)); String sn2 = seriesNameMatcher.matchBySeparator(fn);
if (snbs != null && snbs.length() > 0) { if (sn2 != null && sn2.length() > 0) {
if (snbs.length() < sn.length()) { if (sn2.length() < sn.length()) {
sn = snbs; sn = sn2;
} }
} }
} }
@ -756,7 +761,7 @@ public class MediaDetection {
for (String it : name.split("\\D+")) { for (String it : name.split("\\D+")) {
if (it.length() == 4) { if (it.length() == 4) {
int year = Integer.parseInt(it); int year = Integer.parseInt(it);
if (1920 < year && year < 2050) { if (1950 < year && year < 2050) {
years.add(year); years.add(year);
} }
} }