コード例 #1
0
ファイル: ClientDiscoverTests.cs プロジェクト: navoda/TMDbLib
        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);
        }
コード例 #2
0
        //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);
        }
コード例 #3
0
        public void TestDiscoverMovies()
        {
            DiscoverMovie query = Config.Client.DiscoverMoviesAsync()
                                  .WhereVoteCountIsAtLeast(1000)
                                  .WhereVoteAverageIsAtLeast(2);

            TestHelpers.SearchPages(i => query.Query(i).Result);
        }
コード例 #4
0
        public async Task TestDiscoverMoviesRegionAsync()
        {
            DiscoverMovie query = TMDbClient.DiscoverMoviesAsync()
                                  .WhereReleaseDateIsInRegion("BR")
                                  .WherePrimaryReleaseDateIsAfter(new DateTime(2017, 01, 01));

            await TestHelpers.SearchPagesAsync(i => query.Query(i));
        }
コード例 #5
0
        public async Task TestDiscoverMoviesAsync()
        {
            DiscoverMovie query = TMDbClient.DiscoverMoviesAsync()
                                  .WhereVoteCountIsAtLeast(1000)
                                  .WhereVoteAverageIsAtLeast(2);

            await TestHelpers.SearchPagesAsync(i => query.Query(i));
        }
コード例 #6
0
ファイル: ClientDiscoverTests.cs プロジェクト: navoda/TMDbLib
        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);
        }
コード例 #7
0
ファイル: ClientDiscoverTests.cs プロジェクト: navoda/TMDbLib
        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);
        }
コード例 #8
0
        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));
        }
コード例 #9
0
ファイル: TClient.cs プロジェクト: dpjha84/MovieBuddy
        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);
        }
コード例 #10
0
        //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();
        }
コード例 #11
0
ファイル: Repository.cs プロジェクト: omeryanar/MovieMatrix
        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));
        }