* try to take better into account numbers within series names

This commit is contained in:
Reinhard Pointner 2013-03-27 09:05:52 +00:00
parent ac43c109c0
commit 10fd18c15a
1 changed files with 4 additions and 3 deletions

View File

@ -265,7 +265,8 @@ public enum EpisodeMetrics implements SimilarityMetric {
@Override @Override
protected String normalize(Object object) { protected String normalize(Object object) {
if (object instanceof Episode) { if (object instanceof Episode) {
object = EpisodeFormat.SeasonEpisode.formatSxE((Episode) object); Episode e = (Episode) object;
object = String.format("%s %s", e.getSeriesName(), EpisodeFormat.SeasonEpisode.formatSxE(e));
} else if (object instanceof Movie) { } else if (object instanceof Movie) {
object = ((Movie) object).getYear(); object = ((Movie) object).getYear();
} }
@ -302,12 +303,12 @@ public enum EpisodeMetrics implements SimilarityMetric {
protected String[] fields(Object object) { protected String[] fields(Object object) {
if (object instanceof Episode) { if (object instanceof Episode) {
Episode episode = (Episode) object; Episode episode = (Episode) object;
return new String[] { EpisodeFormat.SeasonEpisode.formatSxE(episode), String.valueOf(episode.getAbsolute()) }; return new String[] { episode.getSeriesName(), EpisodeFormat.SeasonEpisode.formatSxE(episode), String.valueOf(episode.getAbsolute()) };
} }
if (object instanceof Movie) { if (object instanceof Movie) {
Movie movie = (Movie) object; Movie movie = (Movie) object;
return new String[] { String.valueOf(movie.getYear()) }; return new String[] { movie.getName(), String.valueOf(movie.getYear()) };
} }
return new String[] { normalizeObject(object) }; return new String[] { normalizeObject(object) };