Exemplo n.º 1
0
        public SeriesData GetAllSeasonData(int seriesID)
        {
            SeriesData data = new SeriesData();

            try
            {
                TvdbSeries s = m_tvdbHandler.GetSeries(seriesID, TvdbLanguage.DefaultLanguage, true, false, false);
                foreach (TvdbEpisode esp in s.Episodes)
                {
                    if (!data.ContainsSeason(esp.SeasonNumber))
                    {
                        SeasonData newSeason = new SeasonData(esp.SeasonNumber);
                        newSeason.EpisodeList.Add(new EpisodeData(esp.EpisodeName, esp.SeasonNumber, esp.EpisodeNumber));
                        data.SeasonList.Add(newSeason);
                    }
                    else
                    {
                        SeasonData newSeason = data.GetSeason(esp.SeasonNumber);
                        if (newSeason.ContainsEpisode(esp.EpisodeNumber))
                        {
                            continue;
                        }
                        newSeason.EpisodeList.Add(new EpisodeData(esp.EpisodeName, esp.SeasonNumber, esp.EpisodeNumber));
                    }
                }
            }
            catch (Exception) { }
            return(data);
        }
Exemplo n.º 2
0
        public bool ContainsEpisode(int season, int episode)
        {
            SeasonData seasonTemp = _seasonList.FirstOrDefault(item => item.SeasonNumber == season);

            if (seasonTemp == null)
            {
                return(false);
            }

            return(seasonTemp.ContainsEpisode(episode));
        }