Skip to content

Commit

Permalink
fix: Override Sonarr V3 Profiles endpoint (#4678)
Browse files Browse the repository at this point in the history
* Override Sonarr V3 Profiles endpoint [skip ci]
  • Loading branch information
comigor authored Jul 28, 2022
1 parent f8adb5d commit 875da95
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Ombi.Api.Sonarr/SonarrApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public SonarrApi(IApi api)
protected IApi Api { get; }
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);
request.AddHeader("X-Api-Key", apiKey);
Expand Down
9 changes: 9 additions & 0 deletions src/Ombi.Api.Sonarr/SonarrV3Api.cs
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -21,5 +23,12 @@ public async Task<IEnumerable<LanguageProfiles>> LanguageProfiles(string apiKey,

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);
}
}
}

0 comments on commit 875da95

Please sign in to comment.