static void AddSeasonImagesToCache(TmdbSeasonImages images) { if (images != null) { Seasons.TryAdd(Tuple.Create(images.Id, images.Season), images); } }
static void RemoveSeasonImagesFromCache(TmdbSeasonImages images, int season) { if (images != null) { Seasons.RemoveAll(s => s.Id == images.Id && s.Season == season); } }
static void RemoveSeasonImagesFromCache(TmdbSeasonImages images) { if (images != null) { TmdbSeasonImages ignored; Seasons.TryRemove(Tuple.Create(images.Id, images.Season), out ignored); } }
static void AddSeasonImagesToCache(TmdbSeasonImages images, int?id, int season) { if (images != null) { // the id on the request (show) is different on the response (season) images.RequestAge = DateTime.Now.ToString(); images.Season = season; images.Id = id; Seasons.Add(images); } }
public static string GetSeasonPosterUrl(TmdbSeasonImages images) { if (images == null || images.Posters == null) { return(null); } var seasonThumb = images.Posters.LocalisedImage(); if (seasonThumb == null) { return(null); } // return the desired resolution return(TraktSettings.TmdbConfiguration.Images.BaseUrl + TraktSettings.TmdbPreferredPosterSize + seasonThumb.FilePath); }
public static string GetSeasonPosterFilename(TmdbSeasonImages images) { if (images == null || images.Posters == null) { return(null); } var seasonThumb = images.Posters.LocalisedImage(); if (seasonThumb == null) { return(null); } // create filename based on desired resolution return(Path.Combine(Config.GetFolder(Config.Dir.Thumbs), @"Trakt\Seasons\Thumbs\") + images.Id + "_" + TraktSettings.TmdbPreferredPosterSize + "_" + seasonThumb.FilePath.TrimStart('/')); }