Esempio n. 1
0
        /// <summary>
        /// Discover movies filtered by genre.
        /// </summary>
        /// <param name="sortMethod">Enum. The sort option.</param>
        /// <param name="option">Enum. Include adult movies or not.</param>
        /// <returns></returns>
        public async Task <DiscoverMovieRequest> DiscoverGenreMovies(int genre, Sort sortMethod, IncludeAdult option)
        {
            String request = "discover/movie?";

            request += this.Language;
            request += "&" + this.Region;
            request += "&with_genres=" + genre;
            request += "&sort_by=" + DiscoverProvider.SortBy(sortMethod);
            String responseString = await ApiRequest(request, ApiKey);

            responseString = "[" + responseString + "]";
            List <DiscoverMovieRequest> movies = JsonConvert.DeserializeObject <List <DiscoverMovieRequest> >(responseString);

            return(movies.FirstOrDefault());
        }
Esempio n. 2
0
        /// <summary>
        /// Discover movies rated G for kids.
        /// </summary>
        /// <param name="sortMethod">Enum. The sort option.</param>
        /// <param name="option">Enum. Include adult movies or not.</param>
        /// <returns></returns>
        public async Task <DiscoverMovieRequest> DiscoverKidsMovies(Sort sortMethod, IncludeAdult option)
        {
            DateTime date    = DateTime.Now;
            String   request = "discover/movie?";

            request += this.Language;
            request += "&" + this.Region;
            request += "&certification.lte=G";
            request += "&sort_by=" + DiscoverProvider.SortBy(sortMethod);
            String responseString = await ApiRequest(request, ApiKey);

            responseString = "[" + responseString + "]";
            List <DiscoverMovieRequest> movies = JsonConvert.DeserializeObject <List <DiscoverMovieRequest> >(responseString);

            return(movies.FirstOrDefault());
        }
Esempio n. 3
0
        /// <summary>
        /// Discover the movies in theatre untill last month since today.
        /// </summary>
        /// <param name="sortMethod">Enum. The sort option</param>
        /// <param name="option">Enum. Include adult movies or not</param>
        /// <returns></returns>
        public async Task <DiscoverMovieRequest> DiscoverInTheatreMovies(Sort sortMethod, IncludeAdult option)
        {
            DateTime date    = DateTime.Now;
            String   request = "discover/movie?";

            request += this.Language;
            request += "&" + this.Region;
            request += "&primary_release_date.gte=" + date.AddMonths(-1).ToString("yyyy-MM-dd");
            request += "&primary_release_date.lte=" + date.ToString("yyyy-MM-dd");
            request += "&sort_by=" + DiscoverProvider.SortBy(sortMethod);
            String responseString = await ApiRequest(request, ApiKey);

            responseString = "[" + responseString + "]";
            List <DiscoverMovieRequest> movies = JsonConvert.DeserializeObject <List <DiscoverMovieRequest> >(responseString);

            return(movies.FirstOrDefault());
        }