* account for misleading SxE patterns in the episode title

This commit is contained in:
Reinhard Pointner 2013-03-27 06:06:10 +00:00
parent 2f1e21c6a3
commit ac43c109c0
1 changed files with 14 additions and 0 deletions

View File

@ -135,9 +135,23 @@ public enum EpisodeMetrics implements SimilarityMetric {
float sxe = EpisodeIdentifier.getSimilarity(o1, o2);
float title = Title.getSimilarity(o1, o2);
// account for misleading SxE patterns in the episode title
if (sxe < 0 && title == 1 && EpisodeIdentifier.getSimilarity(getTitle(o1), getTitle(o2)) == 1) {
sxe = 1;
title = 0;
}
// 1:SxE && Title, 2:SxE
return (float) ((max(sxe, 0) * title) + (floor(sxe) / 10));
}
public Object getTitle(Object o) {
if (o instanceof Episode) {
return ((Episode) o).getTitle();
}
return o;
}
}),
// Match series title and episode title against folder structure and file name