Inheritance: TmdbRequestAge
Esempio n. 1
0
 static void RemoveShowImagesFromCache(TmdbShowImages images)
 {
     if (images != null)
     {
         Shows.RemoveAll(s => s.Id == images.Id);
     }
 }
Esempio n. 2
0
 static void AddShowImagesToCache(TmdbShowImages images)
 {
     if (images != null)
     {
         images.RequestAge = DateTime.Now.ToString();
         Shows.Add(images);
     }
 }
Esempio n. 3
0
        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;
        }
Esempio n. 4
0
        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('/');
        }
Esempio n. 5
0
        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;
        }
Esempio n. 6
0
        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('/');
        }