mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-30 19:40:05 -07:00
Added new Image posters API
This commit is contained in:
parent
5bf8703c66
commit
560454565d
7 changed files with 62 additions and 10 deletions
|
@ -9,6 +9,7 @@ using Ombi.Store.Entities.Requests;
|
|||
using Ombi.Store.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Ombi.Core.Authentication;
|
||||
using Ombi.Helpers;
|
||||
|
||||
namespace Ombi.Core.Engine.Interfaces
|
||||
{
|
||||
|
@ -29,6 +30,10 @@ namespace Ombi.Core.Engine.Interfaces
|
|||
private OmbiUser _user;
|
||||
protected async Task<OmbiUser> GetUser()
|
||||
{
|
||||
if(!Username.HasValue())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
var username = Username.ToUpper();
|
||||
return _user ?? (_user = await UserManager.Users.FirstOrDefaultAsync(x => x.NormalizedUserName == username));
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace Ombi.Core.Engine.Interfaces
|
|||
Task<IEnumerable<SearchMovieViewModel>> NowPlayingMovies(int currentPosition, int amountToLoad);
|
||||
Task<MovieCollectionsViewModel> GetCollection(int collectionId, CancellationToken cancellationToken, string langCode = null);
|
||||
Task<int> GetTvDbId(int theMovieDbId);
|
||||
Task<IEnumerable<SearchMovieViewModel>> PopularMovies(int currentlyLoaded, int toLoad, CancellationToken cancellationToken);
|
||||
Task<IEnumerable<SearchMovieViewModel>> PopularMovies(int currentlyLoaded, int toLoad, CancellationToken cancellationToken, string langCustomCode = null);
|
||||
Task<IEnumerable<SearchMovieViewModel>> TopRatedMovies(int currentlyLoaded, int toLoad);
|
||||
Task<IEnumerable<SearchMovieViewModel>> UpcomingMovies(int currentlyLoaded, int toLoad);
|
||||
Task<ActorCredits> GetMoviesByActor(int actorId, string langCode);
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace Ombi.Core
|
|||
Task<SearchFullInfoTvShowViewModel> GetShowInformation(string tvdbid, CancellationToken token);
|
||||
Task<SearchFullInfoTvShowViewModel> GetShowByRequest(int requestId, CancellationToken token);
|
||||
Task<IEnumerable<StreamingData>> GetStreamInformation(int movieDbId, CancellationToken cancellationToken);
|
||||
Task<IEnumerable<SearchTvShowViewModel>> Popular(int currentlyLoaded, int amountToLoad);
|
||||
Task<IEnumerable<SearchTvShowViewModel>> Popular(int currentlyLoaded, int amountToLoad, string langCustomCode = null);
|
||||
Task<IEnumerable<SearchTvShowViewModel>> Anticipated(int currentlyLoaded, int amountToLoad);
|
||||
Task<IEnumerable<SearchTvShowViewModel>> Trending(int currentlyLoaded, int amountToLoad);
|
||||
}
|
||||
|
|
|
@ -124,9 +124,9 @@ namespace Ombi.Core.Engine.V2
|
|||
/// Gets popular movies by paging
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<IEnumerable<SearchMovieViewModel>> PopularMovies(int currentlyLoaded, int toLoad, CancellationToken cancellationToken)
|
||||
public async Task<IEnumerable<SearchMovieViewModel>> PopularMovies(int currentlyLoaded, int toLoad, CancellationToken cancellationToken, string langCustomCode = null)
|
||||
{
|
||||
var langCode = await DefaultLanguageCode(null);
|
||||
var langCode = await DefaultLanguageCode(langCustomCode);
|
||||
|
||||
var pages = PaginationHelper.GetNextPages(currentlyLoaded, toLoad, _theMovieDbMaxPageItems);
|
||||
|
||||
|
|
|
@ -107,9 +107,9 @@ namespace Ombi.Core.Engine.V2
|
|||
return await ProcessResult(mapped);
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<SearchTvShowViewModel>> Popular(int currentlyLoaded, int amountToLoad)
|
||||
public async Task<IEnumerable<SearchTvShowViewModel>> Popular(int currentlyLoaded, int amountToLoad, string langCustomCode = null)
|
||||
{
|
||||
var langCode = await DefaultLanguageCode(null);
|
||||
var langCode = await DefaultLanguageCode(langCustomCode);
|
||||
|
||||
var pages = PaginationHelper.GetNextPages(currentlyLoaded, amountToLoad, ResultLimit);
|
||||
var results = new List<MovieDbSearchResult>();
|
||||
|
|
|
@ -58,9 +58,6 @@ namespace Ombi.Core.Models.Search
|
|||
public bool PartlyAvailable { get; set; }
|
||||
public override RequestType Type => RequestType.TvShow;
|
||||
|
||||
/// <summary>
|
||||
/// Only set on the images call
|
||||
/// </summary>
|
||||
public string BackdropPath { get; set; }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue