1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-24 08:48:51 -05:00

* 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

View File

@ -199,7 +199,13 @@ public enum EpisodeMetrics implements SimilarityMetric {
protected Object[] fields(Object object) { protected Object[] fields(Object object) {
if (object instanceof Episode) { if (object instanceof Episode) {
Episode episode = (Episode) object; 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) { if (object instanceof File) {