From be8e50a41f6827cb8f4f4b5edcefe5bf51ac77be Mon Sep 17 00:00:00 2001 From: Qstick Date: Sat, 21 Jan 2023 14:33:34 -0600 Subject: [PATCH] Fixed: Avoid Sqlite Error when all profiles have lowest quality cutoff Closes #2147 Fixes #1911 (cherry picked from commit f05e109b50cca496e7b42e2833eff161a43e12f4) --- src/NzbDrone.Core/Books/Services/BookCutoffService.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/NzbDrone.Core/Books/Services/BookCutoffService.cs b/src/NzbDrone.Core/Books/Services/BookCutoffService.cs index f61323cbd..302b41a98 100644 --- a/src/NzbDrone.Core/Books/Services/BookCutoffService.cs +++ b/src/NzbDrone.Core/Books/Services/BookCutoffService.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Linq; +using NzbDrone.Common.Extensions; using NzbDrone.Core.Datastore; using NzbDrone.Core.Profiles.Qualities; using NzbDrone.Core.Qualities; @@ -39,6 +40,13 @@ namespace NzbDrone.Core.Books } } + if (qualitiesBelowCutoff.Empty()) + { + pagingSpec.Records = new List(); + + return pagingSpec; + } + return _bookRepository.BooksWhereCutoffUnmet(pagingSpec, qualitiesBelowCutoff); } }