Esempio n. 1
0
 static void AddSeasonImagesToCache(TmdbSeasonImages images)
 {
     if (images != null)
     {
         Seasons.TryAdd(Tuple.Create(images.Id, images.Season), images);
     }
 }
Esempio n. 2
0
 static void RemoveSeasonImagesFromCache(TmdbSeasonImages images, int season)
 {
     if (images != null)
     {
         Seasons.RemoveAll(s => s.Id == images.Id && s.Season == season);
     }
 }
Esempio n. 3
0
 static void RemoveSeasonImagesFromCache(TmdbSeasonImages images)
 {
     if (images != null)
     {
         TmdbSeasonImages ignored;
         Seasons.TryRemove(Tuple.Create(images.Id, images.Season), out ignored);
     }
 }
Esempio n. 4
0
 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);
     }
 }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
        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('/'));
        }