* improve matching for specials
This commit is contained in:
parent
b64d63dc60
commit
2dc36b74ec
|
@ -43,11 +43,19 @@ public enum EpisodeMetrics implements SimilarityMetric {
|
||||||
if (object instanceof Episode) {
|
if (object instanceof Episode) {
|
||||||
Episode episode = (Episode) object;
|
Episode episode = (Episode) object;
|
||||||
|
|
||||||
// get SxE from episode, both SxE for season/episode numbering and SxE for absolute episode numbering
|
if (episode.getSpecial() == null) {
|
||||||
SxE sxe = new SxE(episode.getSeason(), episode.getEpisode());
|
// get SxE from episode, both SxE for season/episode numbering and SxE for absolute episode numbering
|
||||||
SxE abs = new SxE(null, episode.getAbsolute());
|
SxE sxe = new SxE(episode.getSeason(), episode.getEpisode());
|
||||||
|
SxE abs = new SxE(null, episode.getAbsolute());
|
||||||
|
|
||||||
result = (abs.episode < 0 || sxe.equals(abs)) ? singleton(sxe) : asList(sxe, abs);
|
result = (abs.episode < 0 || sxe.equals(abs)) ? singleton(sxe) : asList(sxe, abs);
|
||||||
|
} else {
|
||||||
|
// special handling
|
||||||
|
SxE sxe = new SxE(0, episode.getSpecial());
|
||||||
|
SxE sne = new SxE(episode.getSeason(), null);
|
||||||
|
|
||||||
|
return asList(sxe, sne);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
result = super.parse(object);
|
result = super.parse(object);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue