* improved direct series mapping handling
This commit is contained in:
parent
c29be071cf
commit
24f96b5ade
@ -28,7 +28,6 @@ import java.util.regex.Pattern;
|
|||||||
|
|
||||||
import net.filebot.WebServices;
|
import net.filebot.WebServices;
|
||||||
import net.filebot.media.MediaDetection;
|
import net.filebot.media.MediaDetection;
|
||||||
import net.filebot.media.ReleaseInfo;
|
|
||||||
import net.filebot.media.SmartSeasonEpisodeMatcher;
|
import net.filebot.media.SmartSeasonEpisodeMatcher;
|
||||||
import net.filebot.similarity.SeasonEpisodeMatcher.SxE;
|
import net.filebot.similarity.SeasonEpisodeMatcher.SxE;
|
||||||
import net.filebot.vfs.FileInfo;
|
import net.filebot.vfs.FileInfo;
|
||||||
@ -309,7 +308,6 @@ public enum EpisodeMetrics implements SimilarityMetric {
|
|||||||
// Match by generic name similarity (absolute)
|
// Match by generic name similarity (absolute)
|
||||||
SeriesName(new NameSimilarityMetric() {
|
SeriesName(new NameSimilarityMetric() {
|
||||||
|
|
||||||
private ReleaseInfo releaseInfo = new ReleaseInfo();
|
|
||||||
private SeriesNameMatcher seriesNameMatcher = new SeriesNameMatcher(Locale.ROOT, false);
|
private SeriesNameMatcher seriesNameMatcher = new SeriesNameMatcher(Locale.ROOT, false);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -351,22 +349,32 @@ public enum EpisodeMetrics implements SimilarityMetric {
|
|||||||
if (object instanceof Episode) {
|
if (object instanceof Episode) {
|
||||||
names = ((Episode) object).getSeries().getEffectiveNames();
|
names = ((Episode) object).getSeries().getEffectiveNames();
|
||||||
} else if (object instanceof File) {
|
} else if (object instanceof File) {
|
||||||
|
File file = (File) object;
|
||||||
|
|
||||||
|
// check direct mappings first
|
||||||
|
try {
|
||||||
|
List<String> directMapping = MediaDetection.matchSeriesByDirectMapping(singleton(file));
|
||||||
|
if (directMapping.size() > 0) {
|
||||||
|
return directMapping;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
Logger.getLogger(EpisodeMetrics.class.getName()).log(Level.WARNING, e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
// guess potential series names from path
|
||||||
names = new ArrayList<String>(3);
|
names = new ArrayList<String>(3);
|
||||||
for (File f : listPathTail((File) object, 3, true)) {
|
|
||||||
|
for (File f : listPathTail(file, 3, true)) {
|
||||||
String fn = getName(f);
|
String fn = getName(f);
|
||||||
String sn = seriesNameMatcher.matchByEpisodeIdentifier(fn);
|
String sn = seriesNameMatcher.matchByEpisodeIdentifier(fn);
|
||||||
if (sn != null) {
|
names.add(sn != null ? sn : fn);
|
||||||
names.add(sn);
|
|
||||||
} else {
|
|
||||||
names.add(fn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// equally strip away strip potential any clutter
|
// equally strip away strip potential any clutter
|
||||||
if (names != null) {
|
if (names != null) {
|
||||||
try {
|
try {
|
||||||
return releaseInfo.cleanRelease(names, false);
|
return MediaDetection.releaseInfo.cleanRelease(names, false);
|
||||||
} catch (NoSuchElementException e) {
|
} catch (NoSuchElementException e) {
|
||||||
// keep default value in case all tokens are stripped away
|
// keep default value in case all tokens are stripped away
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
@ -181,6 +181,8 @@
|
|||||||
^TV.Series$
|
^TV.Series$
|
||||||
^TV.Show$
|
^TV.Show$
|
||||||
^TV.Shows$
|
^TV.Shows$
|
||||||
|
^tvp
|
||||||
|
^tvs
|
||||||
^Uncompleted.Downloads$
|
^Uncompleted.Downloads$
|
||||||
^unsorted$
|
^unsorted$
|
||||||
^user$
|
^user$
|
||||||
|
@ -11,9 +11,12 @@ law.and.order.svu Law & Order: Special Victims Unit
|
|||||||
M.A.S.H M*A*S*H
|
M.A.S.H M*A*S*H
|
||||||
MASH M*A*S*H
|
MASH M*A*S*H
|
||||||
NCIS.LA NCIS: Los Angeles
|
NCIS.LA NCIS: Los Angeles
|
||||||
|
poid Person of Interest
|
||||||
SuiG7p Suits
|
SuiG7p Suits
|
||||||
TBBT The Big Bang Theory
|
TBBT The Big Bang Theory
|
||||||
tvs.got Game of Thrones
|
tv..got Game of Thrones
|
||||||
|
tv..poi Person of Interest
|
||||||
|
tv..shield Marvel's Agents of S.H.I.E.L.D.
|
||||||
TWD The Walking Dead
|
TWD The Walking Dead
|
||||||
UndG7p Underemployed
|
UndG7p Underemployed
|
||||||
wsop World Series of Poker
|
wsop World Series of Poker
|
Loading…
Reference in New Issue
Block a user