From f05e109b50cca496e7b42e2833eff161a43e12f4 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 --- src/NzbDrone.Core/Tv/EpisodeCutoffService.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/NzbDrone.Core/Tv/EpisodeCutoffService.cs b/src/NzbDrone.Core/Tv/EpisodeCutoffService.cs index ceef1ce3b..ec386230e 100644 --- a/src/NzbDrone.Core/Tv/EpisodeCutoffService.cs +++ b/src/NzbDrone.Core/Tv/EpisodeCutoffService.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Linq; using NLog; +using NzbDrone.Common.Extensions; using NzbDrone.Core.Datastore; using NzbDrone.Core.Languages; using NzbDrone.Core.Profiles.Qualities; @@ -43,6 +44,13 @@ namespace NzbDrone.Core.Tv } } + if (qualitiesBelowCutoff.Empty()) + { + pagingSpec.Records = new List(); + + return pagingSpec; + } + return _episodeRepository.EpisodesWhereCutoffUnmet(pagingSpec, qualitiesBelowCutoff, languagesBelowCutoff, false); } }