Пример #1
0
 private void LoadShow(string showID)
 {
     TVDBLib.SeriesFull series = Program.TVDB.GetSeriesFullInformation(showID, TVDBLib.FileType.ZIP);
     plvSeries.SelectedObject = series.Series;
     LoadBanner(series.Series);
     tvEpisodes.Tag = series.Episodes;
     FillEpisodes(series.Episodes);
     lvBanners.Tag = series.Series.ID;
     FillBanners(series.Banners);
     lvActors.Tag = series.Series.ID;
     FillActors(series.Actors);
 }
Пример #2
0
        private void CalendarRefresh()
        {
            if (Program.Settings.CalenderList.Count > 0)
            {
                int low = (int)nudMinDays.Value, high = (int)nudMaxDays.Value;

                List <CalendarItem> items = new List <CalendarItem>();
                CalendarItem        item;

                foreach (SeriesInfo info in Program.Settings.CalenderList)
                {
                    TVDBLib.SeriesFull series = Program.TVDB.GetSeriesFullInformation(info.SeriesID, TVDBLib.FileType.XML);
                    foreach (TVDBLib.Episode episode in series.Episodes)
                    {
                        item = new CalendarItem();
                        if (!string.IsNullOrEmpty(episode.FirstAired))
                        {
                            item.Date = DateTime.Parse(episode.FirstAired);
                            item.Time = DateTime.Now - item.Date;
                            if (item.Time.Days <= low && item.Time.Days >= -high)
                            {
                                item.SeriesName    = series.Series.SeriesName;
                                item.EpisodeName   = episode.EpisodeName;
                                item.EpisodeNumber = string.Format("S{0:D2}E{1:D2}", int.Parse(episode.SeasonNumber), int.Parse(episode.EpisodeNumber));
                                items.Add(item);
                            }
                        }
                    }
                }

                items = items.OrderByDescending(x => x.Time.Days).ToList();

                lvCalendarList.Items.Clear();

                foreach (CalendarItem episode in items)
                {
                    ListViewItem lvi = new ListViewItem();
                    lvi.Text = episode.SeriesName;
                    lvi.SubItems.Add(episode.EpisodeNumber);
                    lvi.SubItems.Add(episode.EpisodeName);
                    lvi.SubItems.Add(-episode.Time.Days + " days");
                    lvi.SubItems.Add(episode.Date.ToShortDateString());
                    lvCalendarList.Items.Add(lvi);
                }
            }
        }
Пример #3
0
        //http://thetvdb.com/api/90EAA040C265FB5D/series/73739/all/en.xml
        //http://thetvdb.com/api/90EAA040C265FB5D/series/73739/all/en.zip
        public SeriesFull GetSeriesFullInformation(string seriesid, FileType fileType)
        {
            SeriesFull seriesFull = new SeriesFull();

            try
            {
                string path = string.Format("{0}/api/{1}/series/{2}/all/{3}.{4}", ActiveMirror, APIKey, seriesid, ActiveLanguage, fileType.ToString().ToLowerInvariant());
                ConsoleWriteLine("DownloadSeriesFull: " + path);
                if (fileType == FileType.XML)
                {
                    XDocument xml = Cache.CheckSeriesFull(path, seriesid, ActiveLanguage);
                    seriesFull.Series   = ParseSerie(xml.Descendants("Series").ElementAt(0));
                    seriesFull.Episodes = ParseEpisodes(xml);
                }
                else
                {
                    List <SeriesPacket> seriesPackets = Cache.CheckSeriesFullZIP(path, seriesid, ActiveLanguage);
                    foreach (SeriesPacket seriesPacket in seriesPackets)
                    {
                        seriesPacket.Filename = seriesPacket.Filename.ToLowerInvariant();
                        if (seriesPacket.Filename == ActiveLanguage + ".xml")
                        {
                            seriesFull.Series   = ParseSerie(seriesPacket.Data.Descendants("Series").ElementAt(0));
                            seriesFull.Episodes = ParseEpisodes(seriesPacket.Data);
                        }
                        else if (seriesPacket.Filename == "actors.xml")
                        {
                            seriesFull.Actors = ParseActors(seriesPacket.Data);
                        }
                        else if (seriesPacket.Filename == "banners.xml")
                        {
                            seriesFull.Banners = ParseBanners(seriesPacket.Data);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
            return(seriesFull);
        }