From 978946df94a06589c5548aa211ba5d4d9fd92ba3 Mon Sep 17 00:00:00 2001 From: Igor Borges Date: Sat, 18 Jun 2022 14:39:03 -0300 Subject: [PATCH] Override Sonarr V3 Profiles endpoint Although the "official" Sonarr API docs [still states](https://github.com/Sonarr/Sonarr/wiki/Profile) that the Profiles endpoint is `/profile`, that's severely outdated, and the entry on [WikiArr](https://wiki.servarr.com/sonarr) states that "the best way to view see the API is to watch the network calls the frontend makes via the browser development network call console". Well, Sonarr's (own frontend implementation)[https://github.com/Sonarr/Sonarr/blob/93fc9abae91aa4d0093b0df0351d2324b02f8b96/frontend/src/Store/Actions/Settings/qualityProfiles.js#L71] and [NzbDrone proxy](https://github.com/Sonarr/Sonarr/blob/41a821352e3e3e91d5f85cd21da48bd5d0d86452/src/NzbDrone.Core/ImportLists/Sonarr/SonarrV3Proxy.cs#L39) use `/qualityprofile` for it. --- src/Ombi.Api.Sonarr/SonarrV3Api.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Ombi.Api.Sonarr/SonarrV3Api.cs b/src/Ombi.Api.Sonarr/SonarrV3Api.cs index 64377ee4a..98f7dea51 100644 --- a/src/Ombi.Api.Sonarr/SonarrV3Api.cs +++ b/src/Ombi.Api.Sonarr/SonarrV3Api.cs @@ -21,5 +21,12 @@ namespace Ombi.Api.Sonarr return await Api.Request>(request); } + + public 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); + } } }