mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-16 02:02:55 -07:00
feat: Localize genres filter
Localize genres filter
This commit is contained in:
commit
0aa3cd00d9
10 changed files with 45 additions and 21 deletions
|
@ -4,10 +4,15 @@ using System.Threading.Tasks;
|
|||
using Ombi.Api.TheMovieDb.Models;
|
||||
using Ombi.Core.Models.Search.V2;
|
||||
|
||||
// Due to conflicting Genre models in
|
||||
// Ombi.TheMovieDbApi.Models and Ombi.Api.TheMovieDb.Models
|
||||
using Genre = Ombi.TheMovieDbApi.Models.Genre;
|
||||
|
||||
namespace Ombi.Core.Engine.V2
|
||||
{
|
||||
public interface IMultiSearchEngine
|
||||
{
|
||||
Task<List<MultiSearchResult>> MultiSearch(string searchTerm, MultiSearchFilter filter, CancellationToken cancellationToken);
|
||||
Task<IEnumerable<Genre>> GetGenres(string media, CancellationToken requestAborted);
|
||||
}
|
||||
}
|
|
@ -17,6 +17,10 @@ using Ombi.Settings.Settings.Models.External;
|
|||
using Ombi.Store.Entities;
|
||||
using Ombi.Store.Repository;
|
||||
|
||||
// Due to conflicting Genre models in
|
||||
// Ombi.TheMovieDbApi.Models and Ombi.Api.TheMovieDb.Models
|
||||
using Genre = Ombi.TheMovieDbApi.Models.Genre;
|
||||
|
||||
namespace Ombi.Core.Engine.V2
|
||||
{
|
||||
public class MultiSearchEngine : BaseMediaEngine, IMultiSearchEngine
|
||||
|
@ -113,5 +117,11 @@ namespace Ombi.Core.Engine.V2
|
|||
|
||||
return model;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Genre>> GetGenres(string media, CancellationToken cancellationToken)
|
||||
{
|
||||
var lang = await DefaultLanguageCode(null);
|
||||
return await _movieDbApi.GetGenres(media, cancellationToken, lang);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue