From efb18223fed0d51843412f9d30969a654c81c186 Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Sat, 16 Jan 2021 01:32:08 +0100 Subject: [PATCH] Fixed duplicate id searches due to missing Equals on SceneSeasonMapping --- .../Definitions/SceneSeasonMapping.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/NzbDrone.Core/IndexerSearch/Definitions/SceneSeasonMapping.cs b/src/NzbDrone.Core/IndexerSearch/Definitions/SceneSeasonMapping.cs index 66619caed..3fcaff35a 100644 --- a/src/NzbDrone.Core/IndexerSearch/Definitions/SceneSeasonMapping.cs +++ b/src/NzbDrone.Core/IndexerSearch/Definitions/SceneSeasonMapping.cs @@ -11,5 +11,19 @@ namespace NzbDrone.Core.IndexerSearch.Definitions public SearchMode SearchMode { get; set; } public List SceneTitles { get; set; } public int SeasonNumber { get; set; } + + public override int GetHashCode() + { + return SearchMode.GetHashCode() ^ SeasonNumber.GetHashCode(); + } + + public override bool Equals(object obj) + { + var other = obj as SceneSeasonMapping; + + if (object.ReferenceEquals(other, null)) return false; + + return SeasonNumber == other.SeasonNumber && SearchMode == other.SearchMode; + } } }