Exemplo n.º 1
0
 private static void SearchShow(TVDB tvdb)
 {
     Console.WriteLine("Search for Battlestar Galactica on tvdb");
     var searchResults = tvdb.Search("Battlestar Galactica");
     DisplaySearchResult.Print(searchResults);
     Console.WriteLine("-----------");
 }
Exemplo n.º 2
0
 private static void GetSpecificShow(TVDB tvdb)
 {
     Console.WriteLine("Game of Thrones");
     var got = tvdb.GetShow(121361);
     DisplayShowDetails.Print(got);
     Console.WriteLine("-----------");
 }
Exemplo n.º 3
0
 private static void GetSpecificEpisode(TVDB tvdb)
 {
     Console.WriteLine("Game of Thrones s04e01");
     var episode = tvdb.GetEpisode(4721938);
     DisplayEpisodeDetails.Print(episode);
     Console.WriteLine("-----------");
 }
Exemplo n.º 4
0
 private static void GetEpisodeTitlesForSeason(TVDB tvdb)
 {
     Console.WriteLine("Episodes of Game of Thrones season 2");
     var show = tvdb.GetShow(121361);
     var season2Episodes = show.Episodes.Where(ep => ep.SeasonNumber == 2).ToList();
     DisplayEpisodeTitles.Print(season2Episodes);
     Console.WriteLine("-----------");
 }
Exemplo n.º 5
0
        public DisplaySearchResult()
        {
            var apikey = ConfigurationManager.AppSettings["apikey"]; // Your own API key
            var series = "Battlestar Galactica";

            var tvdb = new TVDB(apikey);
            var result = tvdb.Search(series, 3);

            foreach (var show in result) {
                Console.WriteLine("{0}:\t{1}", show.Name, show.ID);
            }

            Console.ReadKey();
        }
        public DisplayEpisodeTitlesForSeason()
        {
            var apikey = ConfigurationManager.AppSettings["apikey"]; // Your own API key
            var seriesid = "76290";

            var tvdb = new TVDB(apikey);
            var result = tvdb.GetShow(seriesid).Episodes.Where(x => x.SeasonNumber == 2).ToList();

            foreach (var episode in result) {
                Console.WriteLine(episode.Title);
            }

            Console.ReadKey();
        }
Exemplo n.º 7
0
 public WriteTvInfoToXml(Show tvShow, string folder)
 {
     var tvdb = new TVDB(_apiKey);
     var _episodeGuide = "http://www.thetvdb.com/api/" + _apiKey + "/series/" + tvShow.Id + "/all/en.zip";
     var actors = tvShow.Actors;
     string _year;
     if (tvShow.FirstAired != null)
     {
         _year = ((DateTime) tvShow.FirstAired).Year.ToString();
     }
     else
     {
         _year = "Unkown year";
     }
     var settings = new XmlWriterSettings
     {
         Indent = true,
         OmitXmlDeclaration = true,
         NewLineOnAttributes = true
     };
     using (XmlWriter writer = XmlWriter.Create(folder + "\\tvshow.nfo", settings))
     {
         writer.WriteStartDocument();
         writer.WriteStartElement("tvshow");
             writer.WriteElementString("title", tvShow.Name);
             writer.WriteElementString("showtitle", tvShow.Name);
             writer.WriteElementString("year", _year);
             writer.WriteElementString("plot", tvShow.Description);
             writer.WriteStartElement("episodeguideurl");
                 writer.WriteElementString("url", _episodeGuide);
             writer.WriteEndElement();
             foreach (var genre in tvShow.Genres)
             {
                 writer.WriteElementString("genre", genre);
             }
             writer.WriteElementString("premiered", tvShow.FirstAired.ToString());
             foreach (var actor in actors)
             {
                 writer.WriteStartElement("actor");
                     writer.WriteElementString("name", actor);
                 writer.WriteEndElement();
             }
             writer.WriteElementString("dateadded", DateTime.Now.ToString());
         writer.WriteEndElement();
         writer.WriteEndDocument();
     }
 }
Exemplo n.º 8
0
        /// <summary>
        /// This example demonstrates the retrieval and display of a show.
        /// </summary>
        public DisplayShowDetails()
        {
            var apikey = ConfigurationManager.AppSettings["apikey"]; // Your own API key
            var seriesid = "76290";

            var tvdb = new TVDB(apikey);
            var result = tvdb.GetShow(seriesid);

            Console.WriteLine("{0}:\t{1}", "IMDB ID", result.ImdbID);
            Console.WriteLine("{0}:\t{1}", "ID", result.ID);
            Console.WriteLine("{0}:\t{1}", "Language", result.Language);
            Console.WriteLine("{0}:\t{1}", "Last update", result.LastUpdated);
            Console.WriteLine("{0}:\t{1}", "Name", result.Name);
            Console.WriteLine("{0}:\t{1}", "Network", result.Network);
            Console.WriteLine("{0}:\t{1}", "Poster", result.Poster);
            Console.WriteLine("{0}:\t{1}", "Rating", result.Rating);
            Console.WriteLine("{0}:\t{1}", "# Votes", result.RatingCount);
            Console.WriteLine("{0}:\t{1}", "Runtime", result.Runtime);
            Console.WriteLine("{0}:\t{1}", "Status", result.Status);
            Console.WriteLine("{0}:\t{1}", "Zap2it ID", result.Zap2ItID);
            Console.WriteLine("{0}:\t{1}", "Airday", result.AirDay);
            Console.WriteLine("{0}:\t{1}", "AirTime", result.AirTime);
            Console.WriteLine("{0}:\t{1}", "Banner", result.Banner);
            Console.WriteLine("{0}:\t{1}", "ContentRating", result.ContentRating);
            Console.WriteLine("{0}:\t{1}", "Description", result.Description);
            Console.WriteLine("{0}:\t{1}", "Fanart", result.Fanart);
            Console.WriteLine("{0}:\t{1}", "First aired", result.FirstAired);

            Console.Write("Actors:\t");
            foreach (var element in result.Actors) {
                Console.Write("{0} | ", element);
            }

            Console.Write("Genres:\t");
            foreach (var element in result.Genres) {
                Console.Write("{0} | ", element);
            }

            Console.Write("Episodes:");
            foreach (var element in result.Episodes) {
                Console.WriteLine(element.Title);
            }

            Console.ReadKey();
        }
Exemplo n.º 9
0
        public static void Main(string[] args)
        {
            // Your own API key
            var tvdb = new TVDB(ConfigurationManager.AppSettings["apikey"]);

            // Retrieve and display Game of Thrones
            //GetSpecificShow(tvdb);

            // Retrieve and display Game of Thrones s04e01
            //GetSpecificEpisode(tvdb);

            // Retrieve and display episode titles for Game of Thrones season 2
            //GetEpisodeTitlesForSeason(tvdb);

            // Search for Battlestar Galactica on tvdb
            //SearchShow(tvdb);

            // Get updates of the last 24 hours
            GetUpdates(tvdb);

            Console.ReadKey();
        }
Exemplo n.º 10
0
        /// <summary>
        /// This example demonstrates the retrieval and display of an episode.
        /// </summary>
        public DisplayEpisodeDetails()
        {
            var apikey = ConfigurationManager.AppSettings["apikey"]; // Your own API key
            var seriesid = "76290";

            var tvdb = new TVDB(apikey);
            var result = tvdb.GetShow(seriesid).Episodes.FirstOrDefault(x => x.EpisodeNumber == 8 && x.SeasonNumber == 2);

            Console.WriteLine("{0}:\t{1}", "IMDB ID", result.ImdbID);
            Console.WriteLine("{0}:\t{1}", "ID", result.ID);
            Console.WriteLine("{0}:\t{1}", "Language", result.Language);
            Console.WriteLine("{0}:\t{1}", "Last update", result.LastUpdated);
            Console.WriteLine("{0}:\t{1}", "Title", result.Title);
            Console.WriteLine("{0}:\t{1}", "Rating", result.Rating);
            Console.WriteLine("{0}:\t{1}", "# Votes", result.RatingCount);
            Console.WriteLine("{0}:\t{1}", "Description", result.Description);
            Console.WriteLine("{0}:\t{1}", "Director", result.Director);
            Console.WriteLine("{0}:\t{1}", "EpisodeNumber", result.EpisodeNumber);
            Console.WriteLine("{0}:\t{1}", "SeasonNumber", result.SeasonNumber);
            Console.WriteLine("{0}:\t{1}", "Filename", result.FileName);
            Console.WriteLine("{0}:\t{1}", "Series ID", result.SeriesID);
            Console.WriteLine("{0}:\t{1}", "Season ID", result.SeasonID);
            Console.WriteLine("{0}:\t{1}", "Thumbnail Height", result.ThumbHeight);
            Console.WriteLine("{0}:\t{1}", "Thumbnail Width", result.ThumbHeight);

            Console.Write("Gueststars:\t");
            foreach (var element in result.GuestStars) {
                Console.Write(element);
            }

            Console.Write("Writers:\t");
            foreach (var element in result.Writers) {
                Console.Write(element);
            }

            Console.ReadKey();
        }
Exemplo n.º 11
0
 private static void GetUpdates(TVDB tvdb)
 {
     var updates = tvdb.GetUpdates(Interval.Day);
     Console.WriteLine("Updates during the last 24 hours on thetvdb, since {0}", updates.Timestamp);
     DisplayUpdates.Print(updates);
 }
Exemplo n.º 12
0
 private void worker_DoWork(object sender, DoWorkEventArgs e)
 {
     var tvdb = new TVDB("8DE2C125BD9D143E");
     _results = tvdb.Search(Path.GetFileName(SelectedFolder), 15);
 }