static void RemoveShowImagesFromCache(TmdbShowImages images) { if (images != null) { Shows.RemoveAll(s => s.Id == images.Id); } }
static void AddShowImagesToCache(TmdbShowImages images) { if (images != null) { images.RequestAge = DateTime.Now.ToString(); Shows.Add(images); } }
public static string GetShowPosterUrl(TmdbShowImages images) { if (images == null || images.Posters == null) return null; var showPoster = images.Posters.LocalisedImage(); if (showPoster == null) return null; // return the desired resolution return TraktSettings.TmdbConfiguration.Images.BaseUrl + TraktSettings.TmdbPreferredPosterSize + showPoster.FilePath; }
public static string GetShowPosterFilename(TmdbShowImages images) { if (images == null || images.Posters == null) return null; var showPoster = images.Posters.LocalisedImage(); if (showPoster == null) return null; // create filename based on desired resolution return Path.Combine(Config.GetFolder(Config.Dir.Thumbs), @"Trakt\Shows\Posters\") + images.Id + "_" + TraktSettings.TmdbPreferredPosterSize + "_" + showPoster.FilePath.TrimStart('/'); }
public static string GetShowBackdropUrl(TmdbShowImages images, bool logo = false) { if (images == null || images.Backdrops == null) return null; TmdbImage showBackdrop = null; if (logo) { // get the highest rated backdrop with a language showBackdrop = images.Backdrops.LocalisedImage(); } else { showBackdrop = images.Backdrops.FirstOrDefault(); } if (showBackdrop == null) return null; // return the desired resolution return TraktSettings.TmdbConfiguration.Images.BaseUrl + (TraktSettings.DownloadFullSizeFanart ? "original" : TraktSettings.TmdbPreferredBackdropSize) + showBackdrop.FilePath; }
public static string GetShowBackdropFilename(TmdbShowImages images, bool logo = false) { if (images == null || images.Backdrops == null) return null; string languagePath = string.Empty; TmdbImage showBackdrop = null; if (logo) { // get the highest rated backdrop with a language showBackdrop = images.Backdrops.LocalisedImage(); } else { showBackdrop = images.Backdrops.FirstOrDefault(); } if (showBackdrop == null) return null; // create filename based on desired resolution return Path.Combine(Config.GetFolder(Config.Dir.Thumbs), @"Trakt\Shows\Backdrops\") + images.Id + "_" + (TraktSettings.DownloadFullSizeFanart ? "original" : TraktSettings.TmdbPreferredBackdropSize) + "_" + showBackdrop.FilePath.TrimStart('/'); }