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; }
private void AddOrUpdateWideSeason([NotNull] Banner banner) { AddUpdateIntoCollections(banner, seasonWideBanners, seasonLangWideBanners); }
public bool SameAs(Banner o) { return (this.BannerId == o.BannerId); }
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); }
private void AddOrUpdateSeasonPoster([NotNull] Banner banner) { AddUpdateIntoCollections(banner, seasonBanners, seasonLangBanners); }
public void AddOrUpdateWideSeason(Banner banner) { AddUpdateIntoCollections(banner, this.WideBanners, this.LangWideBanners); }
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); }
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); }
public void AddOrUpdateSeasonPoster(Banner banner) { AddUpdateIntoCollections(banner, this.Banners, this.LangBanners); }
public void AddOrUpdateSeasonPoster(Banner banner) { AddUpdateIntoCollections(banner, this.SeasonBanners, this.SeasonLangBanners); }
public void AddOrUpdateWideSeason(Banner banner) { AddUpdateIntoCollections(banner, this.SeasonWideBanners, this.SeasonLangWideBanners); }
public bool SameAs(Banner o) { return(this.BannerId == o.BannerId); }
public void AddOrUpdateBanner([NotNull] Banner banner) => banners.AddOrUpdateBanner(banner);
public bool SameAs([NotNull] Banner o) => BannerId == o.BannerId;
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(); } }
public bool SameAs(Banner o) => (BannerId == o.BannerId);