Added more tmdb fields to cache system

This commit is contained in:
2024-09-26 20:26:32 -04:00
parent 35af1eb29b
commit a10f8c9c2f
2 changed files with 10 additions and 0 deletions

View File

@@ -8,5 +8,10 @@ namespace AnimeAnnouncer.Cache
public int LatestSeasonNumber { get; set; }
public int LastEpisodeNumber { get; set; }
public string? PosterPath { get; internal set; }
public string? BackdropPath { get; internal set; }
public string? LatestSeasonPosterPath { get; internal set; }
public string? LatestSeasonOverview { get; internal set; }
public double VoteAverage { get; internal set; }
}
}

View File

@@ -140,6 +140,11 @@ namespace AnimeAnnouncer
_ = tmdbCache.SetCacheItem($"ShowCache-{title}", new TMDBCacheItem()
{
Title = title,
PosterPath = showResult.PosterPath.Length > 0 ? $"https://image.tmdb.org/t/p/original{showResult.PosterPath}" : String.Empty,
BackdropPath = showResult.BackdropPath.Length > 0 ? $"https://image.tmdb.org/t/p/original{showResult.BackdropPath}" : String.Empty,
LatestSeasonPosterPath = latestSeason.PosterPath.Length > 0 ? $"https://image.tmdb.org/t/p/original{latestSeason.PosterPath}" : String.Empty,
LatestSeasonOverview = latestSeason.Overview,
VoteAverage = showResult.VoteAverage,
ShowID = supposedShowId,
LatestSeasonNumber = latestSeason.SeasonNumber,
LastEpisodeNumber = latestSeason.EpisodeCount