private void cmdGetEpisodes_Click(object sender, EventArgs e) { int sId = Int32.Parse(txtSeriesId2.Text); int season = Int32.Parse(txtSeason.Text); int episode = Int32.Parse(txtEpisode.Text); lvSeries.Items.Clear(); TvdbEpisode ep; try { ep = m_tvdbHandler.GetEpisode(sId, season, episode, (TvdbEpisode.EpisodeOrdering)cbOrdering.SelectedItem, TvdbLanguage.DefaultLanguage); lvSeries.Items.Add(CreateItem("Series Id", ep.SeriesId.ToString())); lvSeries.Items.Add(CreateItem("Episode Id", ep.Id.ToString())); lvSeries.Items.Add(CreateItem("Name", ep.EpisodeName)); lvSeries.Items.Add(CreateItem("Gueststars", ep.GuestStarsString)); lvSeries.Items.Add(CreateItem("Directors", ep.DirectorsString)); lvSeries.Items.Add(CreateItem("Writer", ep.WriterString)); lvSeries.Items.Add(CreateItem("Overview", ep.Overview)); lvSeries.Items.Add(CreateItem("Imdb Id", ep.ImdbId)); } catch (TvdbContentNotFoundException ex) { MessageBox.Show("Couldn't find the specified episode"); } }
private void cmdGetEpisodes_Click(object sender, EventArgs e) { int sId = Int32.Parse(txtSeriesId2.Text); int season = Int32.Parse(txtSeason.Text); int episode = Int32.Parse(txtEpisode.Text); TvdbEpisode ep = m_tvdbHandler.GetEpisode(sId, season, episode, (TvdbEpisode.EpisodeOrdering)cbOrdering.SelectedItem, TvdbLanguage.DefaultLanguage); lvSeries.Items.Clear(); lvSeries.Items.Add(CreateItem("Series Id", ep.SeriesId.ToString())); lvSeries.Items.Add(CreateItem("Episode Id", ep.Id.ToString())); lvSeries.Items.Add(CreateItem("Name", ep.EpisodeName)); lvSeries.Items.Add(CreateItem("Gueststars", ep.GuestStarsString)); lvSeries.Items.Add(CreateItem("Directors", ep.DirectorsString)); lvSeries.Items.Add(CreateItem("Writer", ep.WriterString)); lvSeries.Items.Add(CreateItem("Overview", ep.Overview)); lvSeries.Items.Add(CreateItem("Imdb Id", ep.ImdbId)); }
public string getTitle(int seriesID, int season, int episode) { string newTitle = ""; try { if (season > 100) { TvdbEpisode e = m_tvdbHandler.GetEpisode(seriesID, new DateTime(episode, season / 100, season % 100), TvdbLanguage.DefaultLanguage); newTitle = e.EpisodeName; } else { int seasonScale = season; int episodeScale = episode; using (var client = new WebClient()) { var json = client.DownloadString(String.Format("http://thexem.de/map/all?id={0}&origin=tvdb", seriesID)); RootObject m = JsonConvert.DeserializeObject <RootObject>(json); foreach (Datum showData in m.data) { if (showData.scene.episode == episode && showData.scene.season == season) { seasonScale = showData.tvdb.season; episodeScale = showData.tvdb.episode; break; } } } //if (seasonScale == 0 && episodeScale == 0) // return ""; TvdbSeries s = m_tvdbHandler.GetSeries(seriesID, TvdbLanguage.DefaultLanguage, true, false, false); foreach (TvdbEpisode esp in s.Episodes) { if (seasonScale == esp.SeasonNumber && episodeScale == esp.EpisodeNumber) { newTitle = esp.EpisodeName; break; } } } } catch (Exception e) { MessageBox.Show(e.Message.ToString()); } newTitle = newTitle.Replace(":", "").Replace("?", "").Replace("/", "").Replace("<", "").Replace(">", "").Replace("\\", "").Replace("*", "").Replace("|", "").Replace("\"", ""); return(newTitle); }
public string getTitle(int seriesID, int season, int episode) { string newTitle = null; //TvdbEpisode e; try { //if (season > 100) return""; if (season > 100) { TvdbEpisode e = m_tvdbHandler.GetEpisode(seriesID, new DateTime(episode, season / 100, season % 100), TvdbLanguage.DefaultLanguage); newTitle = e.EpisodeName; } else { TvdbSeries s = m_tvdbHandler.GetSeries(seriesID, TvdbLanguage.DefaultLanguage, true, false, false); foreach (TvdbEpisode esp in s.Episodes) { if (season == esp.SeasonNumber && episode == esp.EpisodeNumber) { newTitle = esp.EpisodeName; break; } } } //TvdbSeries s = m_tvdbHandler.GetSeries(seriesID, TvdbLanguage.DefaultLanguage, true, false, false); ////List<string> epList = new List<string>(); //foreach (TvdbEpisode esp in s.Episodes) //{ // if (season == esp.SeasonNumber && episode == esp.EpisodeNumber) // { // newTitle = esp.EpisodeName; // break; // } //} //newTitle = e.EpisodeName; } catch (Exception) { } if (newTitle == null) { return(""); } newTitle = newTitle.Replace(":", "").Replace("?", "").Replace("/", "").Replace("<", "").Replace(">", "").Replace("\\", "").Replace("*", "").Replace("|", "").Replace("\"", ""); return(newTitle); }