mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-15 09:42:56 -07:00
fix: Override Sonarr V3 Profiles endpoint (#4678)
* Override Sonarr V3 Profiles endpoint [skip ci]
This commit is contained in:
parent
f8adb5de85
commit
875da959f3
2 changed files with 10 additions and 1 deletions
|
@ -19,7 +19,7 @@ namespace Ombi.Api.Sonarr
|
||||||
protected IApi Api { get; }
|
protected IApi Api { get; }
|
||||||
protected virtual string ApiBaseUrl => "/api/";
|
protected virtual string ApiBaseUrl => "/api/";
|
||||||
|
|
||||||
public async Task<IEnumerable<SonarrProfile>> GetProfiles(string apiKey, string baseUrl)
|
public virtual async Task<IEnumerable<SonarrProfile>> GetProfiles(string apiKey, string baseUrl)
|
||||||
{
|
{
|
||||||
var request = new Request($"{ApiBaseUrl}profile", baseUrl, HttpMethod.Get);
|
var request = new Request($"{ApiBaseUrl}profile", baseUrl, HttpMethod.Get);
|
||||||
request.AddHeader("X-Api-Key", apiKey);
|
request.AddHeader("X-Api-Key", apiKey);
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
using Ombi.Api.Sonarr.Models;
|
||||||
using Ombi.Api.Sonarr.Models.V3;
|
using Ombi.Api.Sonarr.Models.V3;
|
||||||
|
|
||||||
namespace Ombi.Api.Sonarr
|
namespace Ombi.Api.Sonarr
|
||||||
|
@ -21,5 +23,12 @@ namespace Ombi.Api.Sonarr
|
||||||
|
|
||||||
return await Api.Request<List<LanguageProfiles>>(request);
|
return await Api.Request<List<LanguageProfiles>>(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override async Task<IEnumerable<SonarrProfile>> GetProfiles(string apiKey, string baseUrl)
|
||||||
|
{
|
||||||
|
var request = new Request($"{ApiBaseUrl}qualityprofile", baseUrl, HttpMethod.Get);
|
||||||
|
request.AddHeader("X-Api-Key", apiKey);
|
||||||
|
return await Api.Request<List<SonarrProfile>>(request);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue