public void GetConfiguration() { var result = api.GetConfiguration(); Assert.IsNotNull(result); Console.WriteLine("BaseUrl: " + result.images.base_url); }
public override bool GetResults(string keywords, string imdbID, bool skipImages) { bool result = false; api = new Tmdb(AccessKey, FileManager.Configuration.Options.MovieSheetsOptions.TVShowsLanguage); configuration = api.GetConfiguration(); TmdbMovie movie = null; if (!string.IsNullOrEmpty(imdbID)) { movie = api.GetMovieByIMDB(imdbID, FileManager.Configuration.Options.MovieSheetsOptions.TVShowsLanguage); if (movie != null) { result = GetResults(new[] { movie }); } } if (movie == null)// no imdb identification,use list { var searchResults = api.SearchMovie(Escape(keywords), 1); if (searchResults.results.Any()) { var list = searchResults.results.Select(item => api.GetMovieInfo(item.id)).ToList(); result = GetResults(list); } } return(result); }
void MainPage_Loaded(object sender, RoutedEventArgs e) { // load the config for the image paths var api = new Tmdb(App.ApiKey, null); api.GetConfiguration(null, result => tmdbConfig = result.Data); }
/// <summary> /// Get the Configuration, method will block the current thread /// </summary> public TmdbConfiguration GetConfiguration() { var api = new Tmdb(App.ApiKey, null); TmdbConfiguration result = null; api.GetConfiguration(null, tmdbResult => { result = tmdbResult.Data; _autoResetEvent.Set(); // signal event to continue }); _autoResetEvent.WaitOne(); // block the current thread here until response has been received return(result); }