From 01d7650e9b572dc18674839bfcb98dc68100075d Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Fri, 27 Jul 2012 07:48:17 +0000 Subject: [PATCH] * make Movie hashcode/equals case-insensitive --- source/net/sourceforge/filebot/media/MediaDetection.java | 2 +- source/net/sourceforge/filebot/web/Movie.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/net/sourceforge/filebot/media/MediaDetection.java b/source/net/sourceforge/filebot/media/MediaDetection.java index 02303ec0..d667d915 100644 --- a/source/net/sourceforge/filebot/media/MediaDetection.java +++ b/source/net/sourceforge/filebot/media/MediaDetection.java @@ -214,7 +214,7 @@ public class MediaDetection { } - private static Object getEpisodeIdentifier(CharSequence name, boolean strict) { + public static Object getEpisodeIdentifier(CharSequence name, boolean strict) { // check SxE first Object match = new SeasonEpisodeMatcher(SeasonEpisodeMatcher.DEFAULT_SANITY, strict).match(name); diff --git a/source/net/sourceforge/filebot/web/Movie.java b/source/net/sourceforge/filebot/web/Movie.java index 0b912a37..213ab111 100644 --- a/source/net/sourceforge/filebot/web/Movie.java +++ b/source/net/sourceforge/filebot/web/Movie.java @@ -55,7 +55,7 @@ public class Movie extends SearchResult { return tmdbId == other.tmdbId; } - return year == other.year && name.equals(other.name); + return year == other.year && name.equalsIgnoreCase(other.name); } return false; @@ -70,7 +70,7 @@ public class Movie extends SearchResult { @Override public int hashCode() { - return Arrays.hashCode(new Object[] { name, year }); + return Arrays.hashCode(new Object[] { name.toLowerCase(), year }); }