From c29fba3a2b355f75076a5486cbf40361d2b5571e Mon Sep 17 00:00:00 2001 From: Qstick Date: Sun, 27 Feb 2022 19:10:49 -0600 Subject: [PATCH] Fixed: Convert List to Int before passing to DB Fixes #861 --- src/NzbDrone.Core/History/HistoryRepository.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/History/HistoryRepository.cs b/src/NzbDrone.Core/History/HistoryRepository.cs index 1471d30f2..c61effdbd 100644 --- a/src/NzbDrone.Core/History/HistoryRepository.cs +++ b/src/NzbDrone.Core/History/HistoryRepository.cs @@ -100,11 +100,13 @@ namespace NzbDrone.Core.History public int CountSince(int indexerId, DateTime date, List eventTypes) { + var intEvents = eventTypes.Select(t => (int)t).ToList(); + var builder = new SqlBuilder(_database.DatabaseType) .SelectCount() .Where(x => x.IndexerId == indexerId) .Where(x => x.Date >= date) - .Where(x => eventTypes.Contains(x.EventType)); + .Where(x => intEvents.Contains((int)x.EventType)); var sql = builder.AddPageCountTemplate(typeof(History));