/// <summary> /// <para>Gets the episodes for the given Season in the given order (aired or dvd). Absolute is also possible but makes no sense since /// there are no seasons with absoulte ordering. Use GetEpisodesAbsoluteOrder() instead.</para> /// /// <para>For more information on episode ordering <see href="http://thetvdb.com/wiki/index.php/Category:Episodes">thetvdb wiki</see></para> /// </summary> /// <returns>List of episodes</returns> public List <TvdbEpisode> GetEpisodes(int season, TvdbEpisode.EpisodeOrdering order) { List <TvdbEpisode> episodes = new List <TvdbEpisode>(); _episodes.ForEach(delegate(TvdbEpisode e) { if (e.SeasonNumber == season) { episodes.Add(e); } }); switch (order) { case TvdbEpisode.EpisodeOrdering.DefaultOrder: episodes.Sort(new EpisodeComparerAired()); break; case TvdbEpisode.EpisodeOrdering.DvdOrder: episodes.Sort(new EpisodeComparerDvd()); break; case TvdbEpisode.EpisodeOrdering.AbsoluteOrder: episodes.Sort(new EpisodeComparerAbsolute()); break; } return(episodes); }
/// <summary> /// Retrieve the episode with the given parameters /// </summary> /// <param name="_seriesId">id of the series</param> /// <param name="_seasonNr">season number of the episode</param> /// <param name="_episodeNr">number of the episode</param> /// <param name="_language">language of the episode</param> /// <param name="_order">The sorting order that should be user when downloading the episode</param> /// <returns>The retrieved episode</returns> public TvdbEpisode GetEpisode(int _seriesId, int _seasonNr, int _episodeNr, TvdbEpisode.EpisodeOrdering _order, TvdbLanguage _language) { String order = null; switch (_order) { case TvdbEpisode.EpisodeOrdering.AbsoluteOrder: order = "absolut"; break; case TvdbEpisode.EpisodeOrdering.DefaultOrder: order = "default"; break; case TvdbEpisode.EpisodeOrdering.DvdOrder: order = "dvd"; break; } TvdbEpisode episode = m_downloader.DownloadEpisode(_seriesId, _seasonNr, _episodeNr, order, _language); return(episode); }