public AddModifyRule(ShowRule rule, [NotNull] ShowItem show, int seasonNumber) { mRule = rule; mSeason = show.GetSeason(seasonNumber); mOrder = show.Order; InitializeComponent(); FillDialog(); }
// ReSharper disable once MemberCanBePrivate.Global public static string WebsiteSeasonUrl(string slug, Season.SeasonType type, int seasonNumber) { //format: https://thetvdb.com/series/the-terror/seasons/official/2 switch (type) { case Season.SeasonType.dvd: return($"{WebsiteRoot}/series/{slug}/seasons/dvd/{seasonNumber}"); case Season.SeasonType.aired: return($"{WebsiteRoot}/series/{slug}/seasons/official/{seasonNumber}"); default: throw new ArgumentOutOfRangeException(nameof(type), type, null); } }
// ReSharper disable once MemberCanBePrivate.Global public static string WebsiteSeasonUrl(int seriesId, Season.SeasonType type, int seasonNumber) { //format: return $"{WebsiteRoot}/?tab=season&seriesid={seriesId}&seasonid={seasonId}"; switch (type) { case Season.SeasonType.dvd: return($"{WebsiteRoot}/series/{seriesId}/seasons/dvd/{seasonNumber}"); case Season.SeasonType.aired: return($"{WebsiteRoot}/series/{seriesId}/seasons/official/{seasonNumber}"); default: throw new ArgumentOutOfRangeException(nameof(type), type, null); } }
public int GetSeasonIndex(int seasonNumber, Season.SeasonType type) { Dictionary <int, Season> appropriateSeasons = type == Season.SeasonType.aired ? AiredSeasons : DvdSeasons; List <int> seasonNumbers = new List <int>(); foreach (KeyValuePair <int, Season> sn in appropriateSeasons) { if (sn.Value.IsSpecial()) { continue; } seasonNumbers.Add(sn.Value.SeasonNumber); } seasonNumbers.Sort(); return(seasonNumbers.IndexOf(seasonNumber) + 1); }
public bool HasAnyAirdates(int snum, Season.SeasonType type) { Dictionary <int, Season> seasonsToUse = type == Season.SeasonType.dvd ? DvdSeasons : AiredSeasons; return(seasonsToUse.ContainsKey(snum) && seasonsToUse[snum].Episodes.Values.Any(e => e.FirstAired != null)); }