Example #1
0
        private static SeriesEpisode GetEpisode(HtmlNode node, SeriesSeason season)
        {
            var number = node.SelectSingleNode("td[@class='number-of-episodes']/a").GetAttributeValue("Name", "#");
            var title  = node.SelectSingleNode("td[@class='title-of-episodes']/b").InnerText;
            var date   = node.SelectSingleNode("td[@class='air-date']/span").InnerText;

            return(new SeriesEpisode(number, title, date, season));
        }
Example #2
0
        private static SeriesSeason GetLastSeason(HtmlDocument doc, Series series)
        {
            var last   = GetSeason(doc, series.SeasonsCount);
            var parts  = last.SelectNodes("table[@id='num-season']/tr");
            var season = new SeriesSeason(series.SeasonsCount, series);

            foreach (var elem in parts)
            {
                season.Episods.Add(GetEpisode(elem, season));
            }
            return(season);
        }
        public SeriesEpisode(string number, string title, string date, SeriesSeason parent)
        {
            var res = number.Split('x');

            SeasonNumber  = int.Parse(res[0]);
            EpisodeNumber = int.Parse(res[1]);
            Title         = title;
            if (DateTime.TryParse(date, out var targetDate))
            {
                ReleaseDate = targetDate;
            }
            Parent = parent;
        }