Exemplo n.º 1
0
        public Banner(Banner O)
        {

            this.BannerId = O.BannerId;
            this.BannerPath = O.BannerPath;
            this.BannerType = O.BannerType;
            this.BannerType2 = O.BannerType2;
            this.Language = O.Language;
            this.Rating = O.Rating;
            this.RatingCount = O.RatingCount;
            this.SeasonID = O.SeasonID;
            this.SeriesID = O.SeriesID;

            this.Colors = O.Colors;
            this.ThumbnailPath = O.ThumbnailPath;
            this.VignettePath = O.VignettePath;
            this.SeriesName = O.SeriesName;
            
            this.Name = O.Name;
            this.TheSeason = O.TheSeason;
            this.TheSeries = O.TheSeries;

        }
Exemplo n.º 2
0
 private void AddOrUpdateWideSeason([NotNull] Banner banner)
 {
     AddUpdateIntoCollections(banner, seasonWideBanners, seasonLangWideBanners);
 }
Exemplo n.º 3
0
 public bool SameAs(Banner  o)
 {
     return (this.BannerId == o.BannerId);
 }
Exemplo n.º 4
0
        private void AddUpdateIntoCollection(Banner banner, System.Collections.Generic.Dictionary<int, Banner> coll)
        {
            int seasonOfNewBanner = banner.SeasonID;

            if (coll.ContainsKey(seasonOfNewBanner))
            {
                //it already contains a season of the approprite type - see which is better
                if (coll[seasonOfNewBanner].Rating < banner.Rating)
                {
                    //update banner - we have found a better one
                    coll[seasonOfNewBanner] = banner;
                }

            }
            else
                coll.Add(seasonOfNewBanner, banner);
        }
Exemplo n.º 5
0
 private void AddOrUpdateSeasonPoster([NotNull] Banner banner)
 {
     AddUpdateIntoCollections(banner, seasonBanners, seasonLangBanners);
 }
Exemplo n.º 6
0
 public void AddOrUpdateWideSeason(Banner banner)
 {
     AddUpdateIntoCollections(banner, this.WideBanners, this.LangWideBanners);
 }
Exemplo n.º 7
0
        private void AddUpdateIntoCollections(Banner banner, System.Collections.Generic.Dictionary<int, Banner> coll, System.Collections.Generic.Dictionary<int, Banner> langColl)
        {
            //update language specific cache if appropriate
            if (banner.Language == this.Language)
            {
                AddUpdateIntoCollection(banner,langColl);
            }

            //Now do the same for the all banners dictionary
            AddUpdateIntoCollection(banner, coll);
            
        }
Exemplo n.º 8
0
        public void AddOrUpdateBanner(Banner banner)
        {
            if (AllBanners.ContainsKey(banner.BannerId)){
                AllBanners[banner.BannerId] = banner;
            } else {
                AllBanners.Add(banner.BannerId, banner);
            }

            if (banner.isSeasonPoster()) AddOrUpdateSeasonPoster(banner);
            if (banner.isWideSeason()) AddOrUpdateWideSeason(banner);

        }
Exemplo n.º 9
0
 public void AddOrUpdateSeasonPoster(Banner banner)
 {
     AddUpdateIntoCollections(banner, this.Banners, this.LangBanners);
 }
Exemplo n.º 10
0
 public void AddOrUpdateSeasonPoster(Banner banner)
 {
     AddUpdateIntoCollections(banner, this.SeasonBanners, this.SeasonLangBanners);
 }
Exemplo n.º 11
0
 public void AddOrUpdateWideSeason(Banner banner)
 {
     AddUpdateIntoCollections(banner, this.SeasonWideBanners, this.SeasonLangWideBanners);
 }
Exemplo n.º 12
0
 public bool SameAs(Banner o)
 {
     return(this.BannerId == o.BannerId);
 }
Exemplo n.º 13
0
 public void AddOrUpdateBanner([NotNull] Banner banner) => banners.AddOrUpdateBanner(banner);
Exemplo n.º 14
0
 public bool SameAs([NotNull] Banner o) => BannerId == o.BannerId;
Exemplo n.º 15
0
        public void ProcessTVDBBannerResponse(XmlReader r, int? codeHint)
        {
            r.Read();

            while (!r.EOF)
            {
                if ((r.Name == "Banners")&& r.IsStartElement())
                {
                    r.Read();
                }
                else if ((r.Name == "SeriesId")) 
                {
                    break; //we should never have got here - this is the seriesId that should have been passed in via codehint
                } 
                else if (r.Name == "Banner")
                {
                    Banner b = new Banner(null, null, codeHint, r.ReadSubtree(), Args );

                    if (!this.Series.ContainsKey(b.SeriesID))
                        throw new TVDBException("Can't find the series to add the banner to (TheTVDB).");

                    SeriesInfo ser = this.Series[b.SeriesID];

                    ser.AddOrUpdateBanner(b);

                    r.Read();

                } else if ((r.Name == "Banners") && !r.IsStartElement()){
                    this.Series[(int)codeHint].BannersLoaded = true;
                    break; // that's it.
                }
                
                else if (r.Name == "xml")
                    r.Read();
                else 
                    r.Read();
            }

        }
Exemplo n.º 16
0
 public bool SameAs(Banner o) => (BannerId == o.BannerId);