예제 #1
0
        public void GetConfiguration()
        {
            var result = api.GetConfiguration();

            Assert.IsNotNull(result);
            Console.WriteLine("BaseUrl: " + result.images.base_url);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        /// <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);
        }