mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-04-24 05:47:22 -04:00
Fixed: Convert List<HistoryEventTypes> to Int before passing to DB
Fixes #861
This commit is contained in:
parent
68e41f0860
commit
c29fba3a2b
1 changed files with 3 additions and 1 deletions
|
@ -100,11 +100,13 @@ namespace NzbDrone.Core.History
|
|||
|
||||
public int CountSince(int indexerId, DateTime date, List<HistoryEventType> eventTypes)
|
||||
{
|
||||
var intEvents = eventTypes.Select(t => (int)t).ToList();
|
||||
|
||||
var builder = new SqlBuilder(_database.DatabaseType)
|
||||
.SelectCount()
|
||||
.Where<History>(x => x.IndexerId == indexerId)
|
||||
.Where<History>(x => x.Date >= date)
|
||||
.Where<History>(x => eventTypes.Contains(x.EventType));
|
||||
.Where<History>(x => intEvents.Contains((int)x.EventType));
|
||||
|
||||
var sql = builder.AddPageCountTemplate(typeof(History));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue