public void TestDiscoverMoviesLanguage() { // Ignore missing json IgnoreMissingJson("results[array] / media_type"); DiscoverMovie query = Config.Client.DiscoverMoviesAsync().WhereLanguageIs("da-DK").WherePrimaryReleaseDateIsAfter(new DateTime(2017, 01, 01)); Assert.Equal("Skønheden og Udyret", query.Query(0).Result.Results[11].Title); TestHelpers.SearchPages(i => query.Query(i).Result); }
//Discover Movie through filtering private static PagedResult <Movie> FilterMovies(TMDbClient client, int[] genre, int page, DiscoverMovieSortBy sortby, int year) { DiscoverMovie query = client.DiscoverMoviesAsync().IncludeWithAllOfGenre(genre).WherePrimaryReleaseIsInYear(year).OrderBy(sortby); SearchContainer <SearchMovie> results = query.Query(page).Result; var getMovies = (from result in results.Results select new { Title = result.Title, PosterPath = result.PosterPath, Id = result.Id }).ToList().Select(p => new Movie() { Title = p.Title, PosterPath = p.PosterPath, Id = p.Id }); var pagedMovie = new PagedResult <Movie> { Data = getMovies.ToList(), TotalItems = results.TotalResults, PageNumber = page, PageSize = 21 }; return(pagedMovie); }
public void TestDiscoverMovies() { DiscoverMovie query = Config.Client.DiscoverMoviesAsync() .WhereVoteCountIsAtLeast(1000) .WhereVoteAverageIsAtLeast(2); TestHelpers.SearchPages(i => query.Query(i).Result); }
public async Task TestDiscoverMoviesRegionAsync() { DiscoverMovie query = TMDbClient.DiscoverMoviesAsync() .WhereReleaseDateIsInRegion("BR") .WherePrimaryReleaseDateIsAfter(new DateTime(2017, 01, 01)); await TestHelpers.SearchPagesAsync(i => query.Query(i)); }
public async Task TestDiscoverMoviesAsync() { DiscoverMovie query = TMDbClient.DiscoverMoviesAsync() .WhereVoteCountIsAtLeast(1000) .WhereVoteAverageIsAtLeast(2); await TestHelpers.SearchPagesAsync(i => query.Query(i)); }
public void TestDiscoverMoviesRegion() { // Ignore missing json IgnoreMissingJson("results[array] / media_type"); DiscoverMovie query = Config.Client.DiscoverMoviesAsync().WhereReleaseDateIsInRegion("BR").WherePrimaryReleaseDateIsAfter(new DateTime(2017, 01, 01)); TestHelpers.SearchPages(i => query.Query(i).Result); }
public void TestDiscoverMovies() { // Ignore missing json IgnoreMissingJson("results[array] / media_type"); DiscoverMovie query = Config.Client.DiscoverMoviesAsync() .WhereVoteCountIsAtLeast(1000) .WhereVoteAverageIsAtLeast(2); TestHelpers.SearchPages(i => query.Query(i).Result); }
public void TestDiscoverMoviesOriginalLanguage(string language) { // Ignore missing json IgnoreMissingJson("results[array] / media_type"); DiscoverMovie query = Config.Client.DiscoverMoviesAsync().WhereOriginalLanguageIs(language); List <SearchMovie> results = query.Query(0).Result.Results; Assert.NotEmpty(results); Assert.All(results, item => Assert.Contains(language, item.OriginalLanguage)); }
public List <SearchMovie> Discover(int startYear, int endYear, int genreId, int page = 0) { base.Track(); var movies = new DiscoverMovie(tmdbClient); if (genreId != -1) { movies = movies.IncludeWithAllOfGenre(new List <int> { genreId }); } for (int i = startYear; i <= endYear; i++) { movies = movies.WherePrimaryReleaseIsInYear(i); } return(movies.Query(page).Result.Results); }
//Events //Event when window loads private void Window_Loaded(object sender, RoutedEventArgs e) { DiscoverMovie m = client.DiscoverMoviesAsync().IncludeVideoMovies().WhereReleaseDateIsAfter(DateTime.Now.AddDays(-7)); SearchContainer <SearchMovie> recent = m.Query().Result; //TMDbLib.Objects.Movies.Movie movie = client.GetMovieAsync(47964).Result; //SearchContainer<SearchMovie> results = client.SearchMovieAsync("007").Result; Thread thread = new Thread(() => { foreach (SearchMovie movie in recent.Results) { addMovieToDatabase(movie); } displayContent = true; }); thread.Start(); displayRecentReleases(); }
public async Task <List <MovieContainer> > DiscoverMovieAsync(DiscoverMovie movie, string language, int page, CancellationToken cancellationToken) { var tmdbResult = await movie.Query(language : language, page : page, cancellationToken : cancellationToken); return(GetContainerList(tmdbResult.Results, tmdbResult.TotalResults)); }