fix(discover): TV shows now display on the Actor Pages (#4388)

* Add TV shows to Actor discover page

* Fix actor page not loading after actor change

* Remove user filter from discover actor page

* Clean up code
This commit is contained in:
sephrat 2021-11-10 09:37:35 +01:00 committed by GitHub
parent 907353a54d
commit 6b716e7220
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 57 additions and 12 deletions

View file

@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Ombi.Api.TheMovieDb.Models;
using Ombi.Core.Models.Search;
using Ombi.Core.Models.Search.V2;
@ -10,6 +11,7 @@ namespace Ombi.Core
{
Task<SearchFullInfoTvShowViewModel> GetShowInformation(string tvdbid, CancellationToken token);
Task<SearchFullInfoTvShowViewModel> GetShowByRequest(int requestId, CancellationToken token);
Task<ActorCredits> GetTvByActor(int actorId, string langCode);
Task<IEnumerable<StreamingData>> GetStreamInformation(int movieDbId, CancellationToken cancellationToken);
Task<IEnumerable<SearchTvShowViewModel>> Popular(int currentlyLoaded, int amountToLoad, string langCustomCode = null);
Task<IEnumerable<SearchTvShowViewModel>> Anticipated(int currentlyLoaded, int amountToLoad);

View file

@ -147,6 +147,12 @@ namespace Ombi.Core.Engine.V2
return await processed;
}
public async Task<ActorCredits> GetTvByActor(int actorId, string langCode)
{
var result = await Cache.GetOrAddAsync(nameof(GetTvByActor) + actorId + langCode,
() => _movieApi.GetActorTvCredits(actorId, langCode), DateTimeOffset.Now.AddHours(12));
return result;
}
public async Task<IEnumerable<StreamingData>> GetStreamInformation(int movieDbId, CancellationToken cancellationToken)
{