mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 21:03:17 -07:00
Add backend API calls for genres
This commit is contained in:
parent
341f6583de
commit
c217235d56
7 changed files with 93 additions and 10 deletions
|
@ -13,6 +13,10 @@ using Ombi.Core.Settings.Models.External;
|
|||
using Ombi.Helpers;
|
||||
using Ombi.TheMovieDbApi.Models;
|
||||
|
||||
// Due to conflicting Genre models in
|
||||
// Ombi.TheMovieDbApi.Models and Ombi.Api.TheMovieDb.Models
|
||||
using Genre = Ombi.TheMovieDbApi.Models.Genre;
|
||||
|
||||
namespace Ombi.Api.TheMovieDb
|
||||
{
|
||||
public class TheMovieDbApi : IMovieDbApi
|
||||
|
@ -344,6 +348,16 @@ namespace Ombi.Api.TheMovieDb
|
|||
return keyword == null || keyword.Id == 0 ? null : keyword;
|
||||
}
|
||||
|
||||
public async Task<List<Genre>> GetGenres(string media)
|
||||
{
|
||||
var request = new Request($"genre/{media}/list", BaseUri, HttpMethod.Get);
|
||||
request.AddQueryString("api_key", ApiToken);
|
||||
AddRetry(request);
|
||||
|
||||
var result = await Api.Request<GenreContainer<Genre>>(request);
|
||||
return result.genres ?? new List<Genre>();
|
||||
}
|
||||
|
||||
public Task<TheMovieDbContainer<MultiSearch>> MultiSearch(string searchTerm, string languageCode, CancellationToken cancellationToken)
|
||||
{
|
||||
var request = new Request("search/multi", BaseUri, HttpMethod.Get);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue