* fix corner case for show-equals-title fuzzy logic always tending towards the first episode where the title equals the series name

@see http://www.filebot.net/forums/viewtopic.php?f=6&t=701
This commit is contained in:
Reinhard Pointner 2013-05-09 13:47:03 +00:00
parent 83e0240dd1
commit 19bc3cbe2e
1 changed files with 7 additions and 1 deletions

View File

@ -199,7 +199,13 @@ public enum EpisodeMetrics implements SimilarityMetric {
protected Object[] fields(Object object) {
if (object instanceof Episode) {
Episode episode = (Episode) object;
return new Object[] { removeTrailingBrackets(episode.getSeriesName()), episode.getTitle() };
String seriesName = removeTrailingBrackets(episode.getSeriesName());
String episodeTitle = episode.getTitle();
if (!seriesName.equalsIgnoreCase(episodeTitle)) {
return new Object[] { seriesName, episodeTitle };
} else {
return new Object[] { seriesName, null };
}
}
if (object instanceof File) {