Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override Sonarr V3 Profiles endpoint #4678

Merged
merged 4 commits into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
}
}