From 3c5e7ba37f7c8e38d0a621868dce1ceb8d285ed3 Mon Sep 17 00:00:00 2001 From: Emil Kitti Date: Sun, 28 Mar 2021 04:42:54 +0200 Subject: [PATCH] Verify Sonarr quality override Ombi implicitly trusts that the quality override is set correctly, and causes issues downstream. Line 258 in [TvSender.cs](https://github.com/Ombi-app/Ombi/tree/develop/src/Ombi.Core/Senders/TvSender.cs#L258) it tries to add a series but the, `AddSeries` function in [SonarrApi.cs](https://github.com/Ombi-app/Ombi/blob/develop/src/Ombi.Api.Sonarr/SonarrApi.cs#L92) fails to validate the `NewSeries` object since the `qualityProfileId` attribute is set to `0`. In the end it assumes the series is added in Sonarr and causes a API request with series id set to `0` which causes the following error. ``` [Error] StatusCode: BadRequest, Reason: Bad Request, RequestUri: http://SONARR_HOST/sonarr/api/series/0 ``` --- src/Ombi.Core/Senders/TvSender.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Ombi.Core/Senders/TvSender.cs b/src/Ombi.Core/Senders/TvSender.cs index 9cb98a40b..b812cbb51 100644 --- a/src/Ombi.Core/Senders/TvSender.cs +++ b/src/Ombi.Core/Senders/TvSender.cs @@ -206,7 +206,11 @@ namespace Ombi.Core.Senders // Overrides on the request take priority if (model.ParentRequest.QualityOverride.HasValue) { - qualityToUse = model.ParentRequest.QualityOverride.Value; + overrideQuality = model.ParentRequest.QualityOverride.Value; + if (overrideQuality > 0) + { + qualityToUse = overrideQuality; + } } if (model.ParentRequest.RootFolder.HasValue) { @@ -547,4 +551,4 @@ namespace Ombi.Core.Senders return string.Empty; } } -} \ No newline at end of file +}