From 875da959f353119b05138d68ee6d32a49e14b91e Mon Sep 17 00:00:00 2001 From: Igor Borges Date: Thu, 28 Jul 2022 16:56:30 -0300 Subject: [PATCH] fix: Override Sonarr V3 Profiles endpoint (#4678) * Override Sonarr V3 Profiles endpoint [skip ci] --- src/Ombi.Api.Sonarr/SonarrApi.cs | 2 +- src/Ombi.Api.Sonarr/SonarrV3Api.cs | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Ombi.Api.Sonarr/SonarrApi.cs b/src/Ombi.Api.Sonarr/SonarrApi.cs index d2df50cd9..50e4f04ff 100644 --- a/src/Ombi.Api.Sonarr/SonarrApi.cs +++ b/src/Ombi.Api.Sonarr/SonarrApi.cs @@ -19,7 +19,7 @@ namespace Ombi.Api.Sonarr protected IApi Api { get; } protected virtual string ApiBaseUrl => "/api/"; - public async Task> GetProfiles(string apiKey, string baseUrl) + public virtual async Task> GetProfiles(string apiKey, string baseUrl) { var request = new Request($"{ApiBaseUrl}profile", baseUrl, HttpMethod.Get); request.AddHeader("X-Api-Key", apiKey); diff --git a/src/Ombi.Api.Sonarr/SonarrV3Api.cs b/src/Ombi.Api.Sonarr/SonarrV3Api.cs index 64377ee4a..71c230f35 100644 --- a/src/Ombi.Api.Sonarr/SonarrV3Api.cs +++ b/src/Ombi.Api.Sonarr/SonarrV3Api.cs @@ -1,6 +1,8 @@ using System.Net.Http; using System.Collections.Generic; using System.Threading.Tasks; + +using Ombi.Api.Sonarr.Models; using Ombi.Api.Sonarr.Models.V3; namespace Ombi.Api.Sonarr @@ -21,5 +23,12 @@ namespace Ombi.Api.Sonarr return await Api.Request>(request); } + + public override async Task> GetProfiles(string apiKey, string baseUrl) + { + var request = new Request($"{ApiBaseUrl}qualityprofile", baseUrl, HttpMethod.Get); + request.AddHeader("X-Api-Key", apiKey); + return await Api.Request>(request); + } } }