mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 05:13:18 -07:00
Added the ability to show seasonal content ;)
This commit is contained in:
parent
b406dc0118
commit
bc59a5051e
11 changed files with 97 additions and 3 deletions
|
@ -331,6 +331,32 @@ namespace Ombi.Api.TheMovieDb
|
|||
return await Api.Request<SeasonDetails>(request, token);
|
||||
}
|
||||
|
||||
public async Task<List<MovieDbSearchResult>> GetMoviesViaKeywords(string keywordId, string langCode, CancellationToken cancellationToken, int? page = null)
|
||||
{
|
||||
var request = new Request($"discover/movie", BaseUri, HttpMethod.Get);
|
||||
request.AddQueryString("api_key", ApiToken);
|
||||
request.AddQueryString("language", langCode);
|
||||
request.AddQueryString("sort_by", "vote_average.desc");
|
||||
|
||||
request.AddQueryString("with_keywords", keywordId);
|
||||
|
||||
// `vote_count` consideration isn't explicitly documented, but using only the `sort_by` filter
|
||||
// does not provide the same results as `/movie/top_rated`. This appears to be adequate enough
|
||||
// to filter out extremely high-rated movies due to very little votes
|
||||
request.AddQueryString("vote_count.gte", "250");
|
||||
|
||||
if (page != null)
|
||||
{
|
||||
request.AddQueryString("page", page.ToString());
|
||||
}
|
||||
|
||||
await AddDiscoverSettings(request);
|
||||
await AddGenreFilter(request, "movie");
|
||||
AddRetry(request);
|
||||
var result = await Api.Request<TheMovieDbContainer<SearchResult>>(request, cancellationToken);
|
||||
return Mapper.Map<List<MovieDbSearchResult>>(result.results);
|
||||
}
|
||||
|
||||
public async Task<List<Keyword>> SearchKeyword(string searchTerm)
|
||||
{
|
||||
var request = new Request("search/keyword", BaseUri, HttpMethod.Get);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue