Beispiel #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;

        }
Beispiel #2
0
 private void AddOrUpdateWideSeason([NotNull] Banner banner)
 {
     AddUpdateIntoCollections(banner, seasonWideBanners, seasonLangWideBanners);
 }
Beispiel #3
0
 public bool SameAs(Banner  o)
 {
     return (this.BannerId == o.BannerId);
 }
Beispiel #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);
        }
Beispiel #5
0
 private void AddOrUpdateSeasonPoster([NotNull] Banner banner)
 {
     AddUpdateIntoCollections(banner, seasonBanners, seasonLangBanners);
 }
Beispiel #6
0
 public void AddOrUpdateWideSeason(Banner banner)
 {
     AddUpdateIntoCollections(banner, this.WideBanners, this.LangWideBanners);
 }
Beispiel #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);
            
        }
Beispiel #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);

        }
Beispiel #9
0
 public void AddOrUpdateSeasonPoster(Banner banner)
 {
     AddUpdateIntoCollections(banner, this.Banners, this.LangBanners);
 }
Beispiel #10
0
 public void AddOrUpdateSeasonPoster(Banner banner)
 {
     AddUpdateIntoCollections(banner, this.SeasonBanners, this.SeasonLangBanners);
 }
Beispiel #11
0
 public void AddOrUpdateWideSeason(Banner banner)
 {
     AddUpdateIntoCollections(banner, this.SeasonWideBanners, this.SeasonLangWideBanners);
 }
Beispiel #12
0
 public bool SameAs(Banner o)
 {
     return(this.BannerId == o.BannerId);
 }
Beispiel #13
0
 public void AddOrUpdateBanner([NotNull] Banner banner) => banners.AddOrUpdateBanner(banner);
Beispiel #14
0
 public bool SameAs([NotNull] Banner o) => BannerId == o.BannerId;
Beispiel #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();
            }

        }
Beispiel #16
0
 public bool SameAs(Banner o) => (BannerId == o.BannerId);