mirror of
https://github.com/mitb-archive/filebot
synced 2025-03-10 06:20:27 -04:00
* try simplification by separator (for name - title naming style)
This commit is contained in:
parent
1d19965e72
commit
0415ceb37a
@ -394,6 +394,15 @@ public class MediaDetection {
|
|||||||
for (File path : listPathTail(f, 2, true)) {
|
for (File path : listPathTail(f, 2, true)) {
|
||||||
String sn = seriesNameMatcher.matchByEpisodeIdentifier(getName(path));
|
String sn = seriesNameMatcher.matchByEpisodeIdentifier(getName(path));
|
||||||
if (sn != null && sn.length() > 0) {
|
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);
|
matches.add(sn);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -204,6 +204,17 @@ public class SeriesNameMatcher {
|
|||||||
return null;
|
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.
|
* Try to match a series name from the first common word sequence.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user