// Is successful if this function has a non-null non-empty result to put into the out-param title static public async Task <string> GetEpisodeTitle(string show, string season, string episode) { string title = ""; #if USE_MADTVDB if (show != null && show != "" && season != null && season != "" && episode != null && episode != "") { MadTVDB.MadTVDB madTVDB = new MadTVDB.MadTVDB("C4017334452A0FA1"); TVDBSearchResponse searchResponse = await madTVDB.Search(show); for (int i = 0; i < searchResponse.searchResults.Count; i++) { if (searchResponse.searchResults[i].language == "en") { TVDBSeriesResponse seriesResponse = await madTVDB.SeriesInformation(searchResponse.searchResults[i].seriesID); for (int j = 0; j < seriesResponse.episodes.Count; j++) { if (seriesResponse.episodes[j].seasonNumber == Int32.Parse(season) && seriesResponse.episodes[j].episodeNumber == Int32.Parse(episode)) { title = seriesResponse.episodes[j].episodeName; } } // Only take the first English response from TVDB break; } } } #endif return(title); }
public async Task <TVDBSearchResponse> Search(string query) { TVDBSearchResponse searchResponse = await _tvdbData.Search(query); return(searchResponse); }