From 2dc36b74ec6f068541d2e1f352864d636bdaad41 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sat, 31 Mar 2012 00:59:53 +0000 Subject: [PATCH] * improve matching for specials --- .../filebot/similarity/EpisodeMetrics.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/source/net/sourceforge/filebot/similarity/EpisodeMetrics.java b/source/net/sourceforge/filebot/similarity/EpisodeMetrics.java index 2b9b43d5..847d66bd 100644 --- a/source/net/sourceforge/filebot/similarity/EpisodeMetrics.java +++ b/source/net/sourceforge/filebot/similarity/EpisodeMetrics.java @@ -43,11 +43,19 @@ public enum EpisodeMetrics implements SimilarityMetric { if (object instanceof Episode) { Episode episode = (Episode) object; - // get SxE from episode, both SxE for season/episode numbering and SxE for absolute episode numbering - 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); + if (episode.getSpecial() == null) { + // get SxE from episode, both SxE for season/episode numbering and SxE for absolute episode numbering + 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); + } else { + // special handling + SxE sxe = new SxE(0, episode.getSpecial()); + SxE sne = new SxE(episode.getSeason(), null); + + return asList(sxe, sne); + } } else { result = super.parse(object); }