Esempio n. 1
0
        public static bool Populate(this TvDB_ImageWideBanner poster, int seriesID, TvDbSharper.Clients.Series.Json.Image image)
        {
            if (image.Id == null)
            {
                logger.Error("Error in TvDB_ImageWideBanner.Populate, image.Id is null, series: {0}", seriesID);
                return(false);
            }
            try
            {
                poster.SeriesID = seriesID;
                try
                {
                    poster.SeasonNumber = Int32.Parse(image.SubKey);
                }
                catch (FormatException)
                {
                    poster.SeasonNumber = null;
                }

                poster.Id          = image.Id ?? 0;
                poster.BannerPath  = image.FileName;
                poster.BannerType  = image.KeyType;
                poster.BannerType2 = image.Resolution;
                return(true);
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Error in TvDB_ImageWideBanner.Populate: " + ex.ToString());
                return(false);
            }
        }
Esempio n. 2
0
 public static bool Populate(this TvDB_ImageFanart fanart, int seriesID, TvDbSharper.Clients.Series.Json.Image image)
 {
     if (image.Id == null)
     {
         logger.Error("Error in TvDB_ImageFanart.Populate, image.Id is null, series: {0}", seriesID);
         return(false);
     }
     try
     {
         fanart.SeriesID      = seriesID;
         fanart.Id            = image.Id ?? 0;
         fanart.BannerPath    = image.FileName;
         fanart.BannerType2   = image.Resolution;
         fanart.Colors        = String.Empty;
         fanart.ThumbnailPath = image.Thumbnail;
         fanart.VignettePath  = String.Empty;
         return(true);
     }
     catch (Exception ex)
     {
         logger.Error(ex, "Error in TvDB_ImageFanart.Init: " + ex.ToString());
         return(false);
     }
 }