From eca88d4a8ac957e8606b71bde62fe38790604a5e Mon Sep 17 00:00:00 2001 From: Peyman M <16763358+peymanr34@users.noreply.github.com> Date: Mon, 18 Apr 2022 22:28:09 +0430 Subject: [PATCH] Remove the unnecessary async/awaits. --- .../TheMovieDatabaseService.cs | 565 +++++++----------- 1 file changed, 226 insertions(+), 339 deletions(-) diff --git a/Source/MovieCollection.TheMovieDatabase/TheMovieDatabaseService.cs b/Source/MovieCollection.TheMovieDatabase/TheMovieDatabaseService.cs index 68a9e75..9d66c70 100644 --- a/Source/MovieCollection.TheMovieDatabase/TheMovieDatabaseService.cs +++ b/Source/MovieCollection.TheMovieDatabase/TheMovieDatabaseService.cs @@ -50,7 +50,7 @@ public TheMovieDatabaseService(HttpClient httpClient, TheMovieDatabaseOptions op /// /// A valid session id. /// A representing the asynchronous operation. - public async Task GetAccountDetailsAsync(string sessionId) + public Task GetAccountDetailsAsync(string sessionId) { if (string.IsNullOrWhiteSpace(sessionId)) { @@ -62,8 +62,7 @@ public async Task GetAccountDetailsAsync(string sessionId) ["session_id"] = sessionId, }; - return await GetJsonAsync("/account", parameters) - .ConfigureAwait(false); + return GetJsonAsync("/account", parameters); } // TODO: Account: GetAccountCreatedLists @@ -75,7 +74,7 @@ public async Task GetAccountDetailsAsync(string sessionId) /// A valid session id. /// The page number to query. /// A representing the asynchronous operation. - public async Task> GetAccountFavoriteMoviesAsync(int accountId, string sessionId, int? page = null) + public Task> GetAccountFavoriteMoviesAsync(int accountId, string sessionId, int? page = null) { if (string.IsNullOrWhiteSpace(sessionId)) { @@ -93,8 +92,7 @@ public async Task> GetAccountFavoriteMoviesAsync(int accountI parameters.Add("page", page.Value); } - return await GetJsonAsync>($"/account/{accountId}/favorite/movies", parameters) - .ConfigureAwait(false); + return GetJsonAsync>($"/account/{accountId}/favorite/movies", parameters); } /// @@ -104,7 +102,7 @@ public async Task> GetAccountFavoriteMoviesAsync(int accountI /// A valid session id. /// The page number to query. /// A representing the asynchronous operation. - public async Task> GetAccountFavoriteTVShowsAsync(int accountId, string sessionId, int? page = null) + public Task> GetAccountFavoriteTVShowsAsync(int accountId, string sessionId, int? page = null) { if (string.IsNullOrWhiteSpace(sessionId)) { @@ -122,8 +120,7 @@ public async Task> GetAccountFavoriteTVShowsAsync(int accoun parameters.Add("page", page.Value); } - return await GetJsonAsync>($"/account/{accountId}/favorite/tv", parameters) - .ConfigureAwait(false); + return GetJsonAsync>($"/account/{accountId}/favorite/tv", parameters); } /// @@ -134,7 +131,7 @@ public async Task> GetAccountFavoriteTVShowsAsync(int accoun /// The account id. /// A valid session id. /// A representing the asynchronous operation. - public async Task SetMovieFavoriteAsync(int movieId, bool isFavorite, int accountId, string sessionId) + public Task SetMovieFavoriteAsync(int movieId, bool isFavorite, int accountId, string sessionId) { if (string.IsNullOrWhiteSpace(sessionId)) { @@ -153,8 +150,7 @@ public async Task SetMovieFavoriteAsync(int movieId, bool isFavorite, favorite = isFavorite, }; - return await PostJsonAsync($"/account/{accountId}/favorite", parameters, request) - .ConfigureAwait(false); + return PostJsonAsync($"/account/{accountId}/favorite", parameters, request); } /// @@ -165,7 +161,7 @@ public async Task SetMovieFavoriteAsync(int movieId, bool isFavorite, /// The account id. /// A valid session id. /// A representing the asynchronous operation. - public async Task SetTVShowFavoriteAsync(int tvShowId, bool isFavorite, int accountId, string sessionId) + public Task SetTVShowFavoriteAsync(int tvShowId, bool isFavorite, int accountId, string sessionId) { if (string.IsNullOrWhiteSpace(sessionId)) { @@ -184,8 +180,7 @@ public async Task SetTVShowFavoriteAsync(int tvShowId, bool isFavorite favorite = isFavorite, }; - return await PostJsonAsync($"/account/{accountId}/favorite", parameters, request) - .ConfigureAwait(false); + return PostJsonAsync($"/account/{accountId}/favorite", parameters, request); } /// @@ -195,7 +190,7 @@ public async Task SetTVShowFavoriteAsync(int tvShowId, bool isFavorite /// A valid session id. /// The page number to query. /// A representing the asynchronous operation. - public async Task> GetAccountRatedMoviesAsync(int accountId, string sessionId, int? page = null) + public Task> GetAccountRatedMoviesAsync(int accountId, string sessionId, int? page = null) { if (string.IsNullOrWhiteSpace(sessionId)) { @@ -213,8 +208,7 @@ public async Task> GetAccountRatedMoviesAsync(int accoun parameters.Add("page", page.Value); } - return await GetJsonAsync>($"/account/{accountId}/rated/movies", parameters) - .ConfigureAwait(false); + return GetJsonAsync>($"/account/{accountId}/rated/movies", parameters); } /// @@ -224,7 +218,7 @@ public async Task> GetAccountRatedMoviesAsync(int accoun /// A valid session id. /// The page number to query. /// A representing the asynchronous operation. - public async Task> GetAccountRatedTVShowsAsync(int accountId, string sessionId, int? page = null) + public Task> GetAccountRatedTVShowsAsync(int accountId, string sessionId, int? page = null) { if (string.IsNullOrWhiteSpace(sessionId)) { @@ -242,8 +236,7 @@ public async Task> GetAccountRatedTVShowsAsync(int acco parameters.Add("page", page.Value); } - return await GetJsonAsync>($"/account/{accountId}/rated/tv", parameters) - .ConfigureAwait(false); + return GetJsonAsync>($"/account/{accountId}/rated/tv", parameters); } /// @@ -253,7 +246,7 @@ public async Task> GetAccountRatedTVShowsAsync(int acco /// A valid session id. /// The page number to query. /// A representing the asynchronous operation. - public async Task> GetAccountRatedTVShowEpisodesAsync(int accountId, string sessionId, int? page = null) + public Task> GetAccountRatedTVShowEpisodesAsync(int accountId, string sessionId, int? page = null) { if (string.IsNullOrWhiteSpace(sessionId)) { @@ -271,8 +264,7 @@ public async Task> GetAccountRatedTVShowEpisodesAsync( parameters.Add("page", page.Value); } - return await GetJsonAsync>($"/account/{accountId}/rated/tv/episodes", parameters) - .ConfigureAwait(false); + return GetJsonAsync>($"/account/{accountId}/rated/tv/episodes", parameters); } /// @@ -282,7 +274,7 @@ public async Task> GetAccountRatedTVShowEpisodesAsync( /// A valid session id. /// The page number to query. /// A representing the asynchronous operation. - public async Task> GetAccountMovieWatchlistAsync(int accountId, string sessionId, int? page = null) + public Task> GetAccountMovieWatchlistAsync(int accountId, string sessionId, int? page = null) { if (string.IsNullOrWhiteSpace(sessionId)) { @@ -300,8 +292,7 @@ public async Task> GetAccountMovieWatchlistAsync(int accountI parameters.Add("page", page.Value); } - return await GetJsonAsync>($"/account/{accountId}/watchlist/movies", parameters) - .ConfigureAwait(false); + return GetJsonAsync>($"/account/{accountId}/watchlist/movies", parameters); } /// @@ -311,7 +302,7 @@ public async Task> GetAccountMovieWatchlistAsync(int accountI /// A valid session id. /// The page number to query. /// A representing the asynchronous operation. - public async Task> GetAccountTVShowWatchlistAsync(int accountId, string sessionId, int? page = null) + public Task> GetAccountTVShowWatchlistAsync(int accountId, string sessionId, int? page = null) { if (string.IsNullOrWhiteSpace(sessionId)) { @@ -329,8 +320,7 @@ public async Task> GetAccountTVShowWatchlistAsync(int accoun parameters.Add("page", page.Value); } - return await GetJsonAsync>($"/account/{accountId}/watchlist/tv", parameters) - .ConfigureAwait(false); + return GetJsonAsync>($"/account/{accountId}/watchlist/tv", parameters); } /// @@ -341,7 +331,7 @@ public async Task> GetAccountTVShowWatchlistAsync(int accoun /// The account id. /// A valid session id. /// A representing the asynchronous operation. - public async Task SetMovieWatchlistAsync(int movieId, bool isWatchlist, int accountId, string sessionId) + public Task SetMovieWatchlistAsync(int movieId, bool isWatchlist, int accountId, string sessionId) { if (string.IsNullOrWhiteSpace(sessionId)) { @@ -360,8 +350,7 @@ public async Task SetMovieWatchlistAsync(int movieId, bool isWatchlist watchlist = isWatchlist, }; - return await PostJsonAsync($"/account/{accountId}/watchlist", parameters, request) - .ConfigureAwait(false); + return PostJsonAsync($"/account/{accountId}/watchlist", parameters, request); } /// @@ -372,7 +361,7 @@ public async Task SetMovieWatchlistAsync(int movieId, bool isWatchlist /// The account id. /// A valid session id. /// A representing the asynchronous operation. - public async Task SetTVShowWatchlistAsync(int tvShowId, bool isWatchlist, int accountId, string sessionId) + public Task SetTVShowWatchlistAsync(int tvShowId, bool isWatchlist, int accountId, string sessionId) { if (string.IsNullOrWhiteSpace(sessionId)) { @@ -391,8 +380,7 @@ public async Task SetTVShowWatchlistAsync(int tvShowId, bool isWatchli watchlist = isWatchlist, }; - return await PostJsonAsync($"/account/{accountId}/watchlist", parameters, request) - .ConfigureAwait(false); + return PostJsonAsync($"/account/{accountId}/watchlist", parameters, request); } // TODO: Authentication: CreateGuestSession @@ -401,10 +389,9 @@ public async Task SetTVShowWatchlistAsync(int tvShowId, bool isWatchli /// Creates a temporary request token that can be used to validate a tmdb user login. /// /// A representing the asynchronous operation. - public async Task CreateRequestTokenAsync() + public Task CreateRequestTokenAsync() { - return await GetJsonAsync("/authentication/token/new") - .ConfigureAwait(false); + return GetJsonAsync("/authentication/token/new"); } /// @@ -412,15 +399,14 @@ public async Task CreateRequestTokenAsync() /// /// The approved request token. /// A representing the asynchronous operation. - public async Task CreateSessionAsync(string requestToken) + public Task CreateSessionAsync(string requestToken) { var request = new { request_token = requestToken, }; - return await PostJsonAsync("/authentication/session/new", request) - .ConfigureAwait(false); + return PostJsonAsync("/authentication/session/new", request); } /// @@ -434,7 +420,7 @@ public async Task CreateSessionAsync(string requestToken) /// The password to login. /// The approved request token. /// A representing the asynchronous operation. - public async Task CreateSessionWithLoginAsync(string username, string password, string requestToken) + public Task CreateSessionWithLoginAsync(string username, string password, string requestToken) { var request = new { @@ -443,8 +429,7 @@ public async Task CreateSessionWithLoginAsync(string username, st request_token = requestToken, }; - return await PostJsonAsync("/authentication/token/validate_with_login", request) - .ConfigureAwait(false); + return PostJsonAsync("/authentication/token/validate_with_login", request); } // TODO: Authentication: CreateSessionFromV4 @@ -454,7 +439,7 @@ public async Task CreateSessionWithLoginAsync(string username, st /// /// A valid session id. /// A representing the asynchronous operation. - public async Task DeleteSessionAsync(string sessionId) + public Task DeleteSessionAsync(string sessionId) { if (string.IsNullOrWhiteSpace(sessionId)) { @@ -466,28 +451,25 @@ public async Task DeleteSessionAsync(string sessionId) session_id = sessionId, }; - return await DeleteJsonAsync("/authentication/session", request) - .ConfigureAwait(false); + return DeleteJsonAsync("/authentication/session", request); } /// /// Get an up to date list of the officially supported movie certifications on tmdb. /// /// A representing the asynchronous operation. - public async Task GetMovieCertificationsAsync() + public Task GetMovieCertificationsAsync() { - return await GetJsonAsync("/certification/movie/list") - .ConfigureAwait(false); + return GetJsonAsync("/certification/movie/list"); } /// /// Get an up to date list of the officially supported TV show certifications on tmdb. /// /// A representing the asynchronous operation. - public async Task GetTVShowCertificationsAsync() + public Task GetTVShowCertificationsAsync() { - return await GetJsonAsync("/certification/tv/list") - .ConfigureAwait(false); + return GetJsonAsync("/certification/tv/list"); } // TODO: Changes: GetMovieChanges @@ -499,10 +481,9 @@ public async Task GetTVShowCertificationsAsync() /// /// Id of the collection. /// A representing the asynchronous operation. - public async Task GetCollectionDetailsAsync(int collectionId) + public Task GetCollectionDetailsAsync(int collectionId) { - return await GetJsonAsync($"/collection/{collectionId}") - .ConfigureAwait(false); + return GetJsonAsync($"/collection/{collectionId}"); } /// @@ -510,10 +491,9 @@ public async Task GetCollectionDetailsAsync(int collectionId) /// /// Id of the collection. /// A representing the asynchronous operation. - public async Task GetCollectionImagesAsync(int collectionId) + public Task GetCollectionImagesAsync(int collectionId) { - return await GetJsonAsync($"/collection/{collectionId}/images") - .ConfigureAwait(false); + return GetJsonAsync($"/collection/{collectionId}/images"); } /// @@ -521,10 +501,9 @@ public async Task GetCollectionImagesAsync(int collectionId) /// /// Id of the collection. /// A representing the asynchronous operation. - public async Task> GetCollectionTranslationsAsync(int collectionId) + public Task> GetCollectionTranslationsAsync(int collectionId) { - return await GetJsonAsync>($"/collection/{collectionId}/translations") - .ConfigureAwait(false); + return GetJsonAsync>($"/collection/{collectionId}/translations"); } /// @@ -532,10 +511,9 @@ public async Task> GetCollectionTr /// /// Id of the company. /// A representing the asynchronous operation. - public async Task GetCompanyDetailsAsync(int companyId) + public Task GetCompanyDetailsAsync(int companyId) { - return await GetJsonAsync($"/company/{companyId}") - .ConfigureAwait(false); + return GetJsonAsync($"/company/{companyId}"); } /// @@ -543,10 +521,9 @@ public async Task GetCompanyDetailsAsync(int companyId) /// /// Id of the company. /// A representing the asynchronous operation. - public async Task> GetCompanyAlternativeNamesAsync(int companyId) + public Task> GetCompanyAlternativeNamesAsync(int companyId) { - return await GetJsonAsync>($"/company/{companyId}/alternative_names") - .ConfigureAwait(false); + return GetJsonAsync>($"/company/{companyId}/alternative_names"); } /// @@ -561,10 +538,9 @@ public async Task> GetCompanyAlternativeNamesAsync(int /// /// Id of the company. /// A representing the asynchronous operation. - public async Task GetCompanyImagesAsync(int companyId) + public Task GetCompanyImagesAsync(int companyId) { - return await GetJsonAsync($"/company/{companyId}/images") - .ConfigureAwait(false); + return GetJsonAsync($"/company/{companyId}/images"); } // TODO: Configuration: GetApiConfiguration @@ -579,10 +555,9 @@ public async Task GetCompanyImagesAsync(int companyId) /// /// Id of the credit. /// A representing the asynchronous operation. - public async Task GetCreditDetailsAsync(string creditId) + public Task GetCreditDetailsAsync(string creditId) { - return await GetJsonAsync($"/credit/{creditId}") - .ConfigureAwait(false); + return GetJsonAsync($"/credit/{creditId}"); } /// @@ -601,7 +576,7 @@ public async Task GetCreditDetailsAsync(string creditId) /// Primary Release Year of the movie. /// Page number to query. /// A representing the asynchronous operation. - public async Task> DiscoverMoviesAsync(int? primaryReleaseYear = null, int page = 1) + public Task> DiscoverMoviesAsync(int? primaryReleaseYear = null, int page = 1) { var discover = new NewDiscoverMovie { @@ -609,8 +584,7 @@ public async Task> DiscoverMoviesAsync(int? primaryReleaseYea Page = page, }; - return await DiscoverMoviesAsync(discover) - .ConfigureAwait(false); + return DiscoverMoviesAsync(discover); } /// @@ -618,7 +592,7 @@ public async Task> DiscoverMoviesAsync(int? primaryReleaseYea /// /// An instance of the class. /// A representing the asynchronous operation. - public async Task> DiscoverMoviesAsync(NewDiscoverMovie discover) + public Task> DiscoverMoviesAsync(NewDiscoverMovie discover) { if (discover is null) { @@ -660,8 +634,7 @@ public async Task> DiscoverMoviesAsync(NewDiscoverMovie disco parameters.Add("without_genres", string.Join(",", discover.WithoutGenreIds)); } - return await GetJsonAsync>("/discover/movie", parameters) - .ConfigureAwait(false); + return GetJsonAsync>("/discover/movie", parameters); } /// @@ -674,7 +647,7 @@ public async Task> DiscoverMoviesAsync(NewDiscoverMovie disco /// First air date year. /// Page number to query. /// A representing the asynchronous operation. - public async Task> DiscoverTVShowsAsync(int? firstAirDateYear = null, int page = 1) + public Task> DiscoverTVShowsAsync(int? firstAirDateYear = null, int page = 1) { var discover = new NewDiscoverTVShow { @@ -683,8 +656,7 @@ public async Task> DiscoverTVShowsAsync(int? firstAirDateYea Page = page, }; - return await DiscoverTVShowsAsync(discover) - .ConfigureAwait(false); + return DiscoverTVShowsAsync(discover); } /// @@ -692,7 +664,7 @@ public async Task> DiscoverTVShowsAsync(int? firstAirDateYea /// /// A new instance of the class. /// A representing the asynchronous operation. - public async Task> DiscoverTVShowsAsync(NewDiscoverTVShow discover) + public Task> DiscoverTVShowsAsync(NewDiscoverTVShow discover) { if (discover is null) { @@ -731,8 +703,7 @@ public async Task> DiscoverTVShowsAsync(NewDiscoverTVShow di parameters.Add("include_null_first_air_dates", discover.IncludeNullFirstAirDates); } - return await GetJsonAsync>("/discover/tv", parameters) - .ConfigureAwait(false); + return GetJsonAsync>("/discover/tv", parameters); } /// @@ -742,7 +713,7 @@ public async Task> DiscoverTVShowsAsync(NewDiscoverTVShow di /// External id (e.g. tt0141842 for imdb). /// External source name (e.g. imdb_id or tv_db_id). /// A representing the asynchronous operation. - public async Task FindByExternalIdAsync(string externalId, string externalSource = "imdb_id") + public Task FindByExternalIdAsync(string externalId, string externalSource = "imdb_id") { var parameters = new Dictionary() { @@ -750,28 +721,25 @@ public async Task FindByExternalIdAsync(string externalId, string external ["external_source"] = externalSource, }; - return await GetJsonAsync($"/find/{externalId}", parameters) - .ConfigureAwait(false); + return GetJsonAsync($"/find/{externalId}", parameters); } /// /// Get the list of official genres for movies. /// /// A representing the asynchronous operation. - public async Task GetMovieGenresAsync() + public Task GetMovieGenresAsync() { - return await GetJsonAsync("/genre/movie/list") - .ConfigureAwait(false); + return GetJsonAsync("/genre/movie/list"); } /// /// Get the list of official genres for TV shows. /// /// A representing the asynchronous operation. - public async Task GetTVShowGenresAsync() + public Task GetTVShowGenresAsync() { - return await GetJsonAsync("/genre/tv/list") - .ConfigureAwait(false); + return GetJsonAsync("/genre/tv/list"); } // TODO: Guest Sessions: GetGuestSessionRatedMovies @@ -783,10 +751,9 @@ public async Task GetTVShowGenresAsync() /// /// Id of the keyword. /// A representing the asynchronous operation. - public async Task GetKeywordDetailsAsync(int keywordId) + public Task GetKeywordDetailsAsync(int keywordId) { - return await GetJsonAsync($"/keyword/{keywordId}") - .ConfigureAwait(false); + return GetJsonAsync($"/keyword/{keywordId}"); } /// @@ -797,10 +764,9 @@ public async Task GetKeywordDetailsAsync(int keywordId) /// /// Id of the keyword. /// A representing the asynchronous operation. - public async Task> GetKeywordMoviesAsync(int keywordId) + public Task> GetKeywordMoviesAsync(int keywordId) { - return await GetJsonAsync>($"/keyword/{keywordId}/movies") - .ConfigureAwait(false); + return GetJsonAsync>($"/keyword/{keywordId}/movies"); } // TODO: Lists: GetListDetails @@ -816,15 +782,14 @@ public async Task> GetKeywordMoviesAsync(int keywordId) /// /// Id of the movie. /// A representing the asynchronous operation. - public async Task GetMovieDetailsAsync(int movieId) + public Task GetMovieDetailsAsync(int movieId) { var parameters = new Dictionary() { ["append_to_response"] = "credits,release_dates", }; - return await GetJsonAsync($"/movie/{movieId}", parameters) - .ConfigureAwait(false); + return GetJsonAsync($"/movie/{movieId}", parameters); } // TODO: Movies: GetMovieAccountStates @@ -834,10 +799,9 @@ public async Task GetMovieDetailsAsync(int movieId) /// /// Id of the movie. /// A representing the asynchronous operation. - public async Task> GetMovieAlternativeTitlesAsync(int movieId) + public Task> GetMovieAlternativeTitlesAsync(int movieId) { - return await GetJsonAsync>($"/movie/{movieId}/alternative_titles") - .ConfigureAwait(false); + return GetJsonAsync>($"/movie/{movieId}/alternative_titles"); } // TODO: Movies: GetMovieChanges @@ -847,10 +811,9 @@ public async Task> GetMovieAlternativeTitlesAsync( /// /// Id of the movie. /// A representing the asynchronous operation. - public async Task GetMovieCreditsAsync(int movieId) + public Task GetMovieCreditsAsync(int movieId) { - return await GetJsonAsync($"/movie/{movieId}/credits") - .ConfigureAwait(false); + return GetJsonAsync($"/movie/{movieId}/credits"); } /// @@ -858,10 +821,9 @@ public async Task GetMovieCreditsAsync(int movieId) /// /// Id of the movie. /// A representing the asynchronous operation. - public async Task GetMovieExternalIdsAsync(int movieId) + public Task GetMovieExternalIdsAsync(int movieId) { - return await GetJsonAsync($"/movie/{movieId}/external_ids") - .ConfigureAwait(false); + return GetJsonAsync($"/movie/{movieId}/external_ids"); } /// @@ -869,7 +831,7 @@ public async Task GetMovieExternalIdsAsync(int movieId) /// /// Id of the movie. /// A representing the asynchronous operation. - public async Task GetMovieImagesAsync(int movieId) + public Task GetMovieImagesAsync(int movieId) { var parameters = new Dictionary(); @@ -878,8 +840,7 @@ public async Task GetMovieImagesAsync(int movieId) parameters.Add("include_image_language", _options.ImageFallbackLanguages); } - return await GetJsonAsync($"/movie/{movieId}/images", parameters) - .ConfigureAwait(false); + return GetJsonAsync($"/movie/{movieId}/images", parameters); } /// @@ -887,10 +848,9 @@ public async Task GetMovieImagesAsync(int movieId) /// /// Id of the movie. /// A representing the asynchronous operation. - public async Task GetMovieKeywordsAsync(int movieId) + public Task GetMovieKeywordsAsync(int movieId) { - return await GetJsonAsync($"/movie/{movieId}/keywords") - .ConfigureAwait(false); + return GetJsonAsync($"/movie/{movieId}/keywords"); } /// @@ -898,10 +858,9 @@ public async Task GetMovieKeywordsAsync(int movieId) /// /// Id of the movie. /// A representing the asynchronous operation. - public async Task GetMovieListsAsync(int movieId) + public Task GetMovieListsAsync(int movieId) { - return await GetJsonAsync($"/movie/{movieId}/lists") - .ConfigureAwait(false); + return GetJsonAsync($"/movie/{movieId}/lists"); } /// @@ -909,10 +868,9 @@ public async Task GetMovieListsAsync(int movieId) /// /// Id of the movie. /// A representing the asynchronous operation. - public async Task> GetMovieRecommendationsAsync(int movieId) + public Task> GetMovieRecommendationsAsync(int movieId) { - return await GetJsonAsync>($"/movie/{movieId}/recommendations") - .ConfigureAwait(false); + return GetJsonAsync>($"/movie/{movieId}/recommendations"); } /// @@ -929,10 +887,9 @@ public async Task> GetMovieRecommendationsAsync(int movieId) /// /// Id of the movie. /// A representing the asynchronous operation. - public async Task> GetMovieReleaseDatesAsync(int movieId) + public Task> GetMovieReleaseDatesAsync(int movieId) { - return await GetJsonAsync>($"/movie/{movieId}/release_dates") - .ConfigureAwait(false); + return GetJsonAsync>($"/movie/{movieId}/release_dates"); } /// @@ -940,10 +897,9 @@ public async Task> GetMovieReleaseDatesAsync(int /// /// Id of the movie. /// A representing the asynchronous operation. - public async Task GetMovieReviewsAsync(int movieId) + public Task GetMovieReviewsAsync(int movieId) { - return await GetJsonAsync($"/movie/{movieId}/reviews") - .ConfigureAwait(false); + return GetJsonAsync($"/movie/{movieId}/reviews"); } /// @@ -953,15 +909,14 @@ public async Task GetMovieReviewsAsync(int movieId) /// Id of the movie. /// Specify which page to query. /// A representing the asynchronous operation. - public async Task> GetSimilarMoviesAsync(int movieId, int page = 1) + public Task> GetSimilarMoviesAsync(int movieId, int page = 1) { var parameters = new Dictionary() { ["page"] = page.ToString(CultureInfo.InvariantCulture), }; - return await GetJsonAsync>($"/movie/{movieId}/similar", parameters) - .ConfigureAwait(false); + return GetJsonAsync>($"/movie/{movieId}/similar", parameters); } /// @@ -969,10 +924,9 @@ public async Task> GetSimilarMoviesAsync(int movieId, int pag /// /// Id of the movie. /// A representing the asynchronous operation. - public async Task> GetMovieTranslationsAsync(int movieId) + public Task> GetMovieTranslationsAsync(int movieId) { - return await GetJsonAsync>($"/movie/{movieId}/translations") - .ConfigureAwait(false); + return GetJsonAsync>($"/movie/{movieId}/translations"); } /// @@ -980,10 +934,9 @@ public async Task> GetMovieTranslations /// /// The id of the movie. /// A representing the asynchronous operation. - public async Task> GetMovieVideosAsync(int movieId) + public Task> GetMovieVideosAsync(int movieId) { - return await GetJsonAsync>($"/movie/{movieId}/videos") - .ConfigureAwait(false); + return GetJsonAsync>($"/movie/{movieId}/videos"); } // TODO: Movies: GetMovieWatchProviders @@ -995,7 +948,7 @@ public async Task> GetMovieVideosAsync(int movieId) /// The value of the rating which is expected to be between 0.5 and 10.0. /// A valid session id. /// A representing the asynchronous operation. - public async Task SetMovieRatingAsync(int movieId, double value, string sessionId) + public Task SetMovieRatingAsync(int movieId, double value, string sessionId) { if (string.IsNullOrWhiteSpace(sessionId)) { @@ -1012,8 +965,7 @@ public async Task SetMovieRatingAsync(int movieId, double value, strin value = value, }; - return await PostJsonAsync($"/movie/{movieId}/rating", parameters, request) - .ConfigureAwait(false); + return PostJsonAsync($"/movie/{movieId}/rating", parameters, request); } /// @@ -1022,7 +974,7 @@ public async Task SetMovieRatingAsync(int movieId, double value, strin /// The id of the movie. /// A valid session id. /// A representing the asynchronous operation. - public async Task DeleteMovieRatingAsync(int movieId, string sessionId) + public Task DeleteMovieRatingAsync(int movieId, string sessionId) { if (string.IsNullOrWhiteSpace(sessionId)) { @@ -1034,8 +986,7 @@ public async Task DeleteMovieRatingAsync(int movieId, string sessionId ["session_id"] = sessionId, }; - return await DeleteJsonAsync($"/movie/{movieId}/rating", parameters) - .ConfigureAwait(false); + return DeleteJsonAsync($"/movie/{movieId}/rating", parameters); } /// @@ -1043,10 +994,9 @@ public async Task DeleteMovieRatingAsync(int movieId, string sessionId /// This is a live response and will continuously change. /// /// A representing the asynchronous operation. - public async Task GetLatestMovieAsync() + public Task GetLatestMovieAsync() { - return await GetJsonAsync("/movie/latest") - .ConfigureAwait(false); + return GetJsonAsync("/movie/latest"); } /// @@ -1057,7 +1007,7 @@ public async Task GetLatestMovieAsync() /// Page number to query. /// Specific country. /// A representing the asynchronous operation. - public async Task GetNowPlayingAsync(int page = 1, string region = null) + public Task GetNowPlayingAsync(int page = 1, string region = null) { var parameters = new Dictionary() { @@ -1069,8 +1019,7 @@ public async Task GetNowPlayingAsync(int page = 1, string regi parameters.Add("region", region); } - return await GetJsonAsync("/movie/now_playing") - .ConfigureAwait(false); + return GetJsonAsync("/movie/now_playing"); } /// @@ -1080,7 +1029,7 @@ public async Task GetNowPlayingAsync(int page = 1, string regi /// Page number to query. /// Specific country. /// A representing the asynchronous operation. - public async Task> GetPopularMoviesAsync(int page = 1, string region = null) + public Task> GetPopularMoviesAsync(int page = 1, string region = null) { var parameters = new Dictionary() { @@ -1092,8 +1041,7 @@ public async Task> GetPopularMoviesAsync(int page = 1, string parameters.Add("region", region); } - return await GetJsonAsync>("/movie/popular") - .ConfigureAwait(false); + return GetJsonAsync>("/movie/popular"); } /// @@ -1102,7 +1050,7 @@ public async Task> GetPopularMoviesAsync(int page = 1, string /// Page number to query. /// Specific country. /// A representing the asynchronous operation. - public async Task> GetTopRatedMoviesAsync(int page = 1, string region = null) + public Task> GetTopRatedMoviesAsync(int page = 1, string region = null) { var parameters = new Dictionary() { @@ -1114,8 +1062,7 @@ public async Task> GetTopRatedMoviesAsync(int page = 1, strin parameters.Add("region", region); } - return await GetJsonAsync>("/movie/top_rated") - .ConfigureAwait(false); + return GetJsonAsync>("/movie/top_rated"); } /// @@ -1126,7 +1073,7 @@ public async Task> GetTopRatedMoviesAsync(int page = 1, strin /// Page number to query. /// Specific country. /// A representing the asynchronous operation. - public async Task GetUpcomingMoviesAsync(int page = 1, string region = null) + public Task GetUpcomingMoviesAsync(int page = 1, string region = null) { var parameters = new Dictionary() { @@ -1138,8 +1085,7 @@ public async Task GetUpcomingMoviesAsync(int page = 1, string parameters.Add("region", region); } - return await GetJsonAsync("/movie/upcoming") - .ConfigureAwait(false); + return GetJsonAsync("/movie/upcoming"); } /// @@ -1147,10 +1093,9 @@ public async Task GetUpcomingMoviesAsync(int page = 1, string /// /// Id of the network. /// A representing the asynchronous operation. - public async Task GetNetworkDetailsAsync(int networkId) + public Task GetNetworkDetailsAsync(int networkId) { - return await GetJsonAsync($"/network/{networkId}") - .ConfigureAwait(false); + return GetJsonAsync($"/network/{networkId}"); } /// @@ -1158,10 +1103,9 @@ public async Task GetNetworkDetailsAsync(int networkId) /// /// Id of the network. /// A representing the asynchronous operation. - public async Task> GetNetworkAlternativeNamesAsync(int networkId) + public Task> GetNetworkAlternativeNamesAsync(int networkId) { - return await GetJsonAsync>($"/network/{networkId}/alternative_names") - .ConfigureAwait(false); + return GetJsonAsync>($"/network/{networkId}/alternative_names"); } /// @@ -1173,10 +1117,9 @@ public async Task> GetNetworkAlternativeNamesAsync(int /// /// Id of the network. /// A representing the asynchronous operation. - public async Task GetNetworkImagesAsync(int networkId) + public Task GetNetworkImagesAsync(int networkId) { - return await GetJsonAsync($"/network/{networkId}/images") - .ConfigureAwait(false); + return GetJsonAsync($"/network/{networkId}/images"); } /// @@ -1186,10 +1129,9 @@ public async Task GetNetworkImagesAsync(int networkId) /// /// Time window (e.g. Day or Week). /// A representing the asynchronous operation. - public async Task> GetTrendingMoviesAsync(TimeWindow timeWindow) + public Task> GetTrendingMoviesAsync(TimeWindow timeWindow) { - return await GetJsonAsync>($"/trending/movie/{timeWindow.ToString().ToLowerInvariant()}") - .ConfigureAwait(false); + return GetJsonAsync>($"/trending/movie/{timeWindow.ToString().ToLowerInvariant()}"); } /// @@ -1199,10 +1141,9 @@ public async Task> GetTrendingMoviesAsync(TimeWindow timeWind /// /// Time window (e.g. Day or Week). /// A representing the asynchronous operation. - public async Task> GetTrendingTVShowsAsync(TimeWindow timeWindow) + public Task> GetTrendingTVShowsAsync(TimeWindow timeWindow) { - return await GetJsonAsync>($"/trending/tv/{timeWindow.ToString().ToLowerInvariant()}") - .ConfigureAwait(false); + return GetJsonAsync>($"/trending/tv/{timeWindow.ToString().ToLowerInvariant()}"); } /// @@ -1212,10 +1153,9 @@ public async Task> GetTrendingTVShowsAsync(TimeWindow timeWi /// /// Time window (e.g. Day or Week). /// A representing the asynchronous operation. - public async Task> GetTrendingPeopleAsync(TimeWindow timeWindow) + public Task> GetTrendingPeopleAsync(TimeWindow timeWindow) { - return await GetJsonAsync>($"/trending/person/{timeWindow.ToString().ToLowerInvariant()}") - .ConfigureAwait(false); + return GetJsonAsync>($"/trending/person/{timeWindow.ToString().ToLowerInvariant()}"); } /// @@ -1223,10 +1163,9 @@ public async Task> GetTrendingPeopleAsync(TimeWindow timeWin /// /// Id of the person. /// A representing the asynchronous operation. - public async Task GetPersonDetailsAsync(int personId) + public Task GetPersonDetailsAsync(int personId) { - return await GetJsonAsync($"/person/{personId}") - .ConfigureAwait(false); + return GetJsonAsync($"/person/{personId}"); } // TODO: People: GetPersonChanges @@ -1236,10 +1175,9 @@ public async Task GetPersonDetailsAsync(int personId) /// /// Id of the person. /// A representing the asynchronous operation. - public async Task GetPersonMovieCreditsAsync(int personId) + public Task GetPersonMovieCreditsAsync(int personId) { - return await GetJsonAsync($"/person/{personId}/movie_credits") - .ConfigureAwait(false); + return GetJsonAsync($"/person/{personId}/movie_credits"); } /// @@ -1247,10 +1185,9 @@ public async Task GetPersonMovieCreditsAsync(int personId) /// /// Id of the person. /// A representing the asynchronous operation. - public async Task GetPersonTVShowCreditsAsync(int personId) + public Task GetPersonTVShowCreditsAsync(int personId) { - return await GetJsonAsync($"/person/{personId}/tv_credits") - .ConfigureAwait(false); + return GetJsonAsync($"/person/{personId}/tv_credits"); } /// @@ -1258,10 +1195,9 @@ public async Task GetPersonTVShowCreditsAsync(int personId) /// /// Id of the person. /// A representing the asynchronous operation. - public async Task GetPersonCombinedCreditsAsync(int personId) + public Task GetPersonCombinedCreditsAsync(int personId) { - return await GetJsonAsync($"/person/{personId}/combined_credits") - .ConfigureAwait(false); + return GetJsonAsync($"/person/{personId}/combined_credits"); } /// @@ -1269,10 +1205,9 @@ public async Task GetPersonCombinedCreditsAsync(int perso /// /// Id of the person. /// A representing the asynchronous operation. - public async Task GetPersonExternalIdsAsync(int personId) + public Task GetPersonExternalIdsAsync(int personId) { - return await GetJsonAsync($"/person/{personId}/external_ids") - .ConfigureAwait(false); + return GetJsonAsync($"/person/{personId}/external_ids"); } /// @@ -1280,10 +1215,9 @@ public async Task GetPersonExternalIdsAsync(int personId) /// /// Id of the person. /// A representing the asynchronous operation. - public async Task GetPersonImagesAsync(int personId) + public Task GetPersonImagesAsync(int personId) { - return await GetJsonAsync($"/person/{personId}/images") - .ConfigureAwait(false); + return GetJsonAsync($"/person/{personId}/images"); } /// @@ -1291,10 +1225,9 @@ public async Task GetPersonImagesAsync(int personId) /// /// Id of the person. /// A representing the asynchronous operation. - public async Task> GetPersonTaggedImagesAsync(int personId) + public Task> GetPersonTaggedImagesAsync(int personId) { - return await GetJsonAsync>($"/person/{personId}/tagged_images") - .ConfigureAwait(false); + return GetJsonAsync>($"/person/{personId}/tagged_images"); } /// @@ -1302,30 +1235,27 @@ public async Task> GetPersonTaggedImagesAsync(int personId) /// /// Id of the person. /// A representing the asynchronous operation. - public async Task> GetPersonTranslationsAsync(int personId) + public Task> GetPersonTranslationsAsync(int personId) { - return await GetJsonAsync>($"/person/{personId}/translations") - .ConfigureAwait(false); + return GetJsonAsync>($"/person/{personId}/translations"); } /// /// Get the most newly created person. This is a live response and will continuously change. /// /// A representing the asynchronous operation. - public async Task GetLatestPersonAsync() + public Task GetLatestPersonAsync() { - return await GetJsonAsync("/person/latest") - .ConfigureAwait(false); + return GetJsonAsync("/person/latest"); } /// /// Get the list of popular people on tmdb. This list updates daily. /// /// A representing the asynchronous operation. - public async Task> GetPopularPeopleAsync() + public Task> GetPopularPeopleAsync() { - return await GetJsonAsync>("/person/popular") - .ConfigureAwait(false); + return GetJsonAsync>("/person/popular"); } /// @@ -1333,15 +1263,14 @@ public async Task> GetPopularPeopleAsync() /// /// Id of the review. /// A representing the asynchronous operation. - public async Task GetReviewDetailsAsync(string reviewId) + public Task GetReviewDetailsAsync(string reviewId) { if (string.IsNullOrWhiteSpace(reviewId)) { throw new ArgumentException($"'{nameof(reviewId)}' cannot be null or whitespace", nameof(reviewId)); } - return await GetJsonAsync($"/review/{reviewId}") - .ConfigureAwait(false); + return GetJsonAsync($"/review/{reviewId}"); } /// @@ -1350,7 +1279,7 @@ public async Task GetReviewDetailsAsync(string reviewId) /// Query to search. /// Page number to query. /// A representing the asynchronous operation. - public async Task> SearchCompaniesAsync(string query, int page = 1) + public Task> SearchCompaniesAsync(string query, int page = 1) { if (string.IsNullOrWhiteSpace(query)) { @@ -1363,8 +1292,7 @@ public async Task> SearchCompaniesAsync(string query, ["page"] = page.ToString(CultureInfo.InvariantCulture), }; - return await GetJsonAsync>("/search/company", parameters) - .ConfigureAwait(false); + return GetJsonAsync>("/search/company", parameters); } /// @@ -1373,7 +1301,7 @@ public async Task> SearchCompaniesAsync(string query, /// Search query. /// Page number to query. /// A representing the asynchronous operation. - public async Task> SearchCollectionsAsync(string query, int page = 1) + public Task> SearchCollectionsAsync(string query, int page = 1) { if (string.IsNullOrWhiteSpace(query)) { @@ -1386,8 +1314,7 @@ public async Task> SearchCollectionsAsync(string q ["page"] = page.ToString(CultureInfo.InvariantCulture), }; - return await GetJsonAsync>("/search/collection", parameters) - .ConfigureAwait(false); + return GetJsonAsync>("/search/collection", parameters); } /// @@ -1396,7 +1323,7 @@ public async Task> SearchCollectionsAsync(string q /// Search query. /// page number to query. /// A representing the asynchronous operation. - public async Task> SearchKeywordsAsync(string query, int page = 1) + public Task> SearchKeywordsAsync(string query, int page = 1) { if (string.IsNullOrWhiteSpace(query)) { @@ -1409,8 +1336,7 @@ public async Task> SearchKeywordsAsync(string query, int pa ["page"] = page.ToString(CultureInfo.InvariantCulture), }; - return await GetJsonAsync>("/search/keyword", parameters) - .ConfigureAwait(false); + return GetJsonAsync>("/search/keyword", parameters); } /// @@ -1422,7 +1348,7 @@ public async Task> SearchKeywordsAsync(string query, int pa /// Page number to query. /// Specific country. /// A representing the asynchronous operation. - public async Task> SearchMoviesAsync(string query, int? primaryReleaseYear = null, int? year = null, int page = 1, string region = null) + public Task> SearchMoviesAsync(string query, int? primaryReleaseYear = null, int? year = null, int page = 1, string region = null) { if (string.IsNullOrWhiteSpace(query)) { @@ -1451,8 +1377,7 @@ public async Task> SearchMoviesAsync(string query, int? prima parameters.Add("region", region); } - return await GetJsonAsync>("/search/movie", parameters) - .ConfigureAwait(false); + return GetJsonAsync>("/search/movie", parameters); } // TODO: Search: MultiSearch @@ -1463,7 +1388,7 @@ public async Task> SearchMoviesAsync(string query, int? prima /// Search query. /// Page number to query. /// A representing the asynchronous operation. - public async Task> SearchPeopleAsync(string query, int page = 1) + public Task> SearchPeopleAsync(string query, int page = 1) { var parameters = new Dictionary() { @@ -1471,8 +1396,7 @@ public async Task> SearchPeopleAsync(string query, int ["page"] = page.ToString(CultureInfo.InvariantCulture), }; - return await GetJsonAsync>("/search/person", parameters) - .ConfigureAwait(false); + return GetJsonAsync>("/search/person", parameters); } /// @@ -1482,7 +1406,7 @@ public async Task> SearchPeopleAsync(string query, int /// First air year of the show. /// Query page number. /// A representing the asynchronous operation. - public async Task> SearchTVShowsAsync(string query, int? firstAirYear = null, int page = 1) + public Task> SearchTVShowsAsync(string query, int? firstAirYear = null, int page = 1) { if (string.IsNullOrWhiteSpace(query)) { @@ -1500,8 +1424,7 @@ public async Task> SearchTVShowsAsync(string query, int? fir parameters.Add("first_air_date_year", firstAirYear); } - return await GetJsonAsync>("/search/tv", parameters) - .ConfigureAwait(false); + return GetJsonAsync>("/search/tv", parameters); } /// @@ -1509,15 +1432,14 @@ public async Task> SearchTVShowsAsync(string query, int? fir /// /// Id of the TV show. /// A representing the asynchronous operation. - public async Task GetTVShowDetailsAsync(int tvShowId) + public Task GetTVShowDetailsAsync(int tvShowId) { var parameters = new Dictionary() { ["append_to_response"] = "credits,external_ids,content_ratings", }; - return await GetJsonAsync($"/tv/{tvShowId}", parameters) - .ConfigureAwait(false); + return GetJsonAsync($"/tv/{tvShowId}", parameters); } // TODO: TV: GetTVShowAccountStates @@ -1528,10 +1450,9 @@ public async Task GetTVShowDetailsAsync(int tvShowId) /// /// Id of the tv show. /// A representing the asynchronous operation. - public async Task> GetTVShowAlternativeTitlesAsync(int tvShowId) + public Task> GetTVShowAlternativeTitlesAsync(int tvShowId) { - return await GetJsonAsync>($"/tv/{tvShowId}/alternative_titles") - .ConfigureAwait(false); + return GetJsonAsync>($"/tv/{tvShowId}/alternative_titles"); } // TODO: TV: GetTVShowChanges @@ -1541,10 +1462,9 @@ public async Task> GetTVShowAlternativeTitlesAsync /// /// Id of the TV show. /// A representing the asynchronous operation. - public async Task> GetTVShowContentRatingsAsync(int tvShowId) + public Task> GetTVShowContentRatingsAsync(int tvShowId) { - return await GetJsonAsync>($"/tv/{tvShowId}/content_ratings") - .ConfigureAwait(false); + return GetJsonAsync>($"/tv/{tvShowId}/content_ratings"); } /// @@ -1552,10 +1472,9 @@ public async Task> GetTVShowContentRatingsAsync(int /// /// Id of the TV show. /// A representing the asynchronous operation. - public async Task GetTVShowCreditsAsync(int tvShowId) + public Task GetTVShowCreditsAsync(int tvShowId) { - return await GetJsonAsync($"/tv/{tvShowId}/credits") - .ConfigureAwait(false); + return GetJsonAsync($"/tv/{tvShowId}/credits"); } /// @@ -1566,10 +1485,9 @@ public async Task GetTVShowCreditsAsync(int tvShowId) /// /// Id of the tv show. /// A representing the asynchronous operation. - public async Task> GetTVShowEpisodeGroupsAsync(int tvShowId) + public Task> GetTVShowEpisodeGroupsAsync(int tvShowId) { - return await GetJsonAsync>($"/tv/{tvShowId}/episode_groups") - .ConfigureAwait(false); + return GetJsonAsync>($"/tv/{tvShowId}/episode_groups"); } /// @@ -1577,10 +1495,9 @@ public async Task> GetTVShowEpisodeGroupsAsync(int tvS /// /// Id of the TV show. /// A representing the asynchronous operation. - public async Task GetTVShowExternalIdsAsync(int tvShowId) + public Task GetTVShowExternalIdsAsync(int tvShowId) { - return await GetJsonAsync($"/tv/{tvShowId}/external_ids") - .ConfigureAwait(false); + return GetJsonAsync($"/tv/{tvShowId}/external_ids"); } /// @@ -1588,7 +1505,7 @@ public async Task GetTVShowExternalIdsAsync(int tvShowId) /// /// Id of the TV show. /// A representing the asynchronous operation. - public async Task GetTVShowImagesAsync(int tvShowId) + public Task GetTVShowImagesAsync(int tvShowId) { var parameters = new Dictionary(); @@ -1597,8 +1514,7 @@ public async Task GetTVShowImagesAsync(int tvShowId) parameters.Add("include_image_language", _options.ImageFallbackLanguages); } - return await GetJsonAsync($"/tv/{tvShowId}/images", parameters) - .ConfigureAwait(false); + return GetJsonAsync($"/tv/{tvShowId}/images", parameters); } /// @@ -1606,10 +1522,9 @@ public async Task GetTVShowImagesAsync(int tvShowId) /// /// Id of the tv show. /// A representing the asynchronous operation. - public async Task> GetTVShowKeywordsAsync(int tvShowId) + public Task> GetTVShowKeywordsAsync(int tvShowId) { - return await GetJsonAsync>($"/tv/{tvShowId}/keywords") - .ConfigureAwait(false); + return GetJsonAsync>($"/tv/{tvShowId}/keywords"); } /// @@ -1617,10 +1532,9 @@ public async Task> GetTVShowKeywordsAsync(int tvShowId) /// /// The id of the tv show. /// A representing the asynchronous operation. - public async Task> GetTVShowRecommendationsAsync(int tvShowId) + public Task> GetTVShowRecommendationsAsync(int tvShowId) { - return await GetJsonAsync>($"/tv/{tvShowId}/recommendations") - .ConfigureAwait(false); + return GetJsonAsync>($"/tv/{tvShowId}/recommendations"); } /// @@ -1628,10 +1542,9 @@ public async Task> GetTVShowRecommendationsAsync(int tvShowI /// /// Id of the tv show. /// A representing the asynchronous operation. - public async Task GetTVShowReviewsAsync(int tvShowId) + public Task GetTVShowReviewsAsync(int tvShowId) { - return await GetJsonAsync($"/tv/{tvShowId}/reviews") - .ConfigureAwait(false); + return GetJsonAsync($"/tv/{tvShowId}/reviews"); } /// @@ -1639,10 +1552,9 @@ public async Task GetTVShowReviewsAsync(int tvShowId) /// /// Id of the tv show. /// A representing the asynchronous operation. - public async Task> GetTVShowScreenedTheatricallyAsync(int tvShowId) + public Task> GetTVShowScreenedTheatricallyAsync(int tvShowId) { - return await GetJsonAsync>($"/tv/{tvShowId}/screened_theatrically") - .ConfigureAwait(false); + return GetJsonAsync>($"/tv/{tvShowId}/screened_theatrically"); } /// @@ -1652,15 +1564,14 @@ public async Task> GetTVShowScreenedTheatrical /// Id of the tv show. /// Specify which page to query. /// A representing the asynchronous operation. - public async Task> GetSimilarTVShowsAsync(int tvShowId, int page = 1) + public Task> GetSimilarTVShowsAsync(int tvShowId, int page = 1) { var parameters = new Dictionary() { ["page"] = page.ToString(CultureInfo.InvariantCulture), }; - return await GetJsonAsync>($"/tv/{tvShowId}/similar", parameters) - .ConfigureAwait(false); + return GetJsonAsync>($"/tv/{tvShowId}/similar", parameters); } /// @@ -1668,10 +1579,9 @@ public async Task> GetSimilarTVShowsAsync(int tvShowId, int p /// /// Id of the tv show. /// A representing the asynchronous operation. - public async Task> GetTVShowTranslationsAsync(int tvShowId) + public Task> GetTVShowTranslationsAsync(int tvShowId) { - return await GetJsonAsync>($"/tv/{tvShowId}/translations") - .ConfigureAwait(false); + return GetJsonAsync>($"/tv/{tvShowId}/translations"); } /// @@ -1679,10 +1589,9 @@ public async Task> GetTVShowTranslatio /// /// Id of the tv show. /// A representing the asynchronous operation. - public async Task> GetTVShowVideosAsync(int tvShowId) + public Task> GetTVShowVideosAsync(int tvShowId) { - return await GetJsonAsync>($"/tv/{tvShowId}/videos") - .ConfigureAwait(false); + return GetJsonAsync>($"/tv/{tvShowId}/videos"); } // TODO: TV: GetTVShowWatchProviders @@ -1694,7 +1603,7 @@ public async Task> GetTVShowVideosAsync(int tvShowId) /// The value of the rating which is expected to be between 0.5 and 10.0. /// A valid session id. /// A representing the asynchronous operation. - public async Task SetTVShowRatingAsync(int tvShowId, double value, string sessionId) + public Task SetTVShowRatingAsync(int tvShowId, double value, string sessionId) { if (string.IsNullOrWhiteSpace(sessionId)) { @@ -1711,8 +1620,7 @@ public async Task SetTVShowRatingAsync(int tvShowId, double value, str value = value, }; - return await PostJsonAsync($"/tv/{tvShowId}/rating", parameters, request) - .ConfigureAwait(false); + return PostJsonAsync($"/tv/{tvShowId}/rating", parameters, request); } /// @@ -1721,7 +1629,7 @@ public async Task SetTVShowRatingAsync(int tvShowId, double value, str /// The id of the tv show. /// A valid session id. /// A representing the asynchronous operation. - public async Task DeleteTVShowRatingAsync(int tvShowId, string sessionId) + public Task DeleteTVShowRatingAsync(int tvShowId, string sessionId) { if (string.IsNullOrWhiteSpace(sessionId)) { @@ -1733,8 +1641,7 @@ public async Task DeleteTVShowRatingAsync(int tvShowId, string session ["session_id"] = sessionId, }; - return await DeleteJsonAsync($"/tv/{tvShowId}/rating", parameters) - .ConfigureAwait(false); + return DeleteJsonAsync($"/tv/{tvShowId}/rating", parameters); } /// @@ -1742,10 +1649,9 @@ public async Task DeleteTVShowRatingAsync(int tvShowId, string session /// This is a live response and will continuously change. /// /// A representing the asynchronous operation. - public async Task GetLatestTVShowAsync() + public Task GetLatestTVShowAsync() { - return await GetJsonAsync("/tv/latest") - .ConfigureAwait(false); + return GetJsonAsync("/tv/latest"); } /// @@ -1753,15 +1659,14 @@ public async Task GetLatestTVShowAsync() /// /// Specify which page to query. /// A representing the asynchronous operation. - public async Task> GetAiringTodayTVShowsAsync(int page = 1) + public Task> GetAiringTodayTVShowsAsync(int page = 1) { var parameters = new Dictionary() { ["page"] = page.ToString(CultureInfo.InvariantCulture), }; - return await GetJsonAsync>("/tv/airing_today", parameters) - .ConfigureAwait(false); + return GetJsonAsync>("/tv/airing_today", parameters); } /// @@ -1770,15 +1675,14 @@ public async Task> GetAiringTodayTVShowsAsync(int page = 1) /// /// Specify which page to query. /// A representing the asynchronous operation. - public async Task> GetOnTheAirTVShowsAsync(int page = 1) + public Task> GetOnTheAirTVShowsAsync(int page = 1) { var parameters = new Dictionary() { ["page"] = page.ToString(CultureInfo.InvariantCulture), }; - return await GetJsonAsync>("/tv/on_the_air", parameters) - .ConfigureAwait(false); + return GetJsonAsync>("/tv/on_the_air", parameters); } /// @@ -1786,15 +1690,14 @@ public async Task> GetOnTheAirTVShowsAsync(int page = 1) /// /// Specify which page to query. /// A representing the asynchronous operation. - public async Task> GetPopularTVShowsAsync(int page = 1) + public Task> GetPopularTVShowsAsync(int page = 1) { var parameters = new Dictionary() { ["page"] = page.ToString(CultureInfo.InvariantCulture), }; - return await GetJsonAsync>("/tv/popular", parameters) - .ConfigureAwait(false); + return GetJsonAsync>("/tv/popular", parameters); } /// @@ -1802,15 +1705,14 @@ public async Task> GetPopularTVShowsAsync(int page = 1) /// /// Specify which page to query. /// A representing the asynchronous operation. - public async Task> GetTopRatedTVShowsAsync(int page = 1) + public Task> GetTopRatedTVShowsAsync(int page = 1) { var parameters = new Dictionary() { ["page"] = page.ToString(CultureInfo.InvariantCulture), }; - return await GetJsonAsync>("/tv/top_rated", parameters) - .ConfigureAwait(false); + return GetJsonAsync>("/tv/top_rated", parameters); } /// @@ -1819,10 +1721,9 @@ public async Task> GetTopRatedTVShowsAsync(int page = 1) /// Id of the tv show. /// Season number. /// A representing the asynchronous operation. - public async Task GetTVShowSeasonDetailsAsync(int tvShowId, int seasonNumber) + public Task GetTVShowSeasonDetailsAsync(int tvShowId, int seasonNumber) { - return await GetJsonAsync($"/tv/{tvShowId}/season/{seasonNumber}") - .ConfigureAwait(false); + return GetJsonAsync($"/tv/{tvShowId}/season/{seasonNumber}"); } // TODO: TV Seasons: GetTVShowSeasonAccountStates @@ -1835,10 +1736,9 @@ public async Task GetTVShowSeasonDetailsAsync(int tvShowId, int s /// Id of the tv show. /// Season number. /// A representing the asynchronous operation. - public async Task GetTVShowSeasonCreditsAsync(int tvShowId, int seasonNumber) + public Task GetTVShowSeasonCreditsAsync(int tvShowId, int seasonNumber) { - return await GetJsonAsync($"/tv/{tvShowId}/season/{seasonNumber}/credits") - .ConfigureAwait(false); + return GetJsonAsync($"/tv/{tvShowId}/season/{seasonNumber}/credits"); } /// @@ -1847,10 +1747,9 @@ public async Task GetTVShowSeasonCreditsAsync(int tvShowId, int s /// Id of the tv show. /// Season number. /// A representing the asynchronous operation. - public async Task GetTVShowSeasonExternalIdsAsync(int tvShowId, int seasonNumber) + public Task GetTVShowSeasonExternalIdsAsync(int tvShowId, int seasonNumber) { - return await GetJsonAsync($"/tv/{tvShowId}/season/{seasonNumber}/external_ids") - .ConfigureAwait(false); + return GetJsonAsync($"/tv/{tvShowId}/season/{seasonNumber}/external_ids"); } /// @@ -1859,7 +1758,7 @@ public async Task GetTVShowSeasonExternalIdsAsync(int tvShowI /// Id of the TV show. /// Season number. /// A representing the asynchronous operation. - public async Task GetTVShowSeasonImagesAsync(int tvShowId, int seasonNumber) + public Task GetTVShowSeasonImagesAsync(int tvShowId, int seasonNumber) { var parameters = new Dictionary(); @@ -1868,8 +1767,7 @@ public async Task GetTVShowSeasonImagesAsync(int tvShowId, i parameters.Add("include_image_language", _options.ImageFallbackLanguages); } - return await GetJsonAsync($"/tv/{tvShowId}/season/{seasonNumber}/images", parameters) - .ConfigureAwait(false); + return GetJsonAsync($"/tv/{tvShowId}/season/{seasonNumber}/images", parameters); } /// @@ -1878,10 +1776,9 @@ public async Task GetTVShowSeasonImagesAsync(int tvShowId, i /// Id of the tv show. /// Season number. /// A representing the asynchronous operation. - public async Task> GetTVShowSeasonTranslationsAsync(int tvShowId, int seasonNumber) + public Task> GetTVShowSeasonTranslationsAsync(int tvShowId, int seasonNumber) { - return await GetJsonAsync>($"/tv/{tvShowId}/season/{seasonNumber}/translations") - .ConfigureAwait(false); + return GetJsonAsync>($"/tv/{tvShowId}/season/{seasonNumber}/translations"); } /// @@ -1890,10 +1787,9 @@ public async Task> GetTVShowSeasonTran /// Id of the TV show. /// Season number. /// A representing the asynchronous operation. - public async Task> GetTVShowSeasonVideosAsync(int tvShowId, int seasonNumber) + public Task> GetTVShowSeasonVideosAsync(int tvShowId, int seasonNumber) { - return await GetJsonAsync>($"/tv/{tvShowId}/season/{seasonNumber}/videos") - .ConfigureAwait(false); + return GetJsonAsync>($"/tv/{tvShowId}/season/{seasonNumber}/videos"); } /// @@ -1903,10 +1799,9 @@ public async Task> GetTVShowSeasonVideosAsync(int tvShowId, i /// Season number. /// Episode number. /// A representing the asynchronous operation. - public async Task GetTVShowEpisodeDetailsAsync(int tvShowId, int seasonNumber, int episodeNumber) + public Task GetTVShowEpisodeDetailsAsync(int tvShowId, int seasonNumber, int episodeNumber) { - return await GetJsonAsync($"/tv/{tvShowId}/season/{seasonNumber}/episode/{episodeNumber}") - .ConfigureAwait(false); + return GetJsonAsync($"/tv/{tvShowId}/season/{seasonNumber}/episode/{episodeNumber}"); } // TODO: TV Episodes: GetTVShowEpisodeAccountStates @@ -1919,10 +1814,9 @@ public async Task GetTVShowEpisodeDetailsAsync(int tvShowId, int /// Season number. /// Episode number. /// A representing the asynchronous operation. - public async Task GetTVShowEpisodeCreditsAsync(int tvShowId, int seasonNumber, int episodeNumber) + public Task GetTVShowEpisodeCreditsAsync(int tvShowId, int seasonNumber, int episodeNumber) { - return await GetJsonAsync($"/tv/{tvShowId}/season/{seasonNumber}/episode/{episodeNumber}/credits") - .ConfigureAwait(false); + return GetJsonAsync($"/tv/{tvShowId}/season/{seasonNumber}/episode/{episodeNumber}/credits"); } /// @@ -1932,10 +1826,9 @@ public async Task GetTVShowEpisodeCreditsAsync(int tvShowI /// Season number. /// Episode number. /// A representing the asynchronous operation. - public async Task GetTVShowEpisodeExternalIdsAsync(int tvShowId, int seasonNumber, int episodeNumber) + public Task GetTVShowEpisodeExternalIdsAsync(int tvShowId, int seasonNumber, int episodeNumber) { - return await GetJsonAsync($"/tv/{tvShowId}/season/{seasonNumber}/episode/{episodeNumber}/external_ids") - .ConfigureAwait(false); + return GetJsonAsync($"/tv/{tvShowId}/season/{seasonNumber}/episode/{episodeNumber}/external_ids"); } /// @@ -1945,10 +1838,9 @@ public async Task GetTVShowEpisodeExternalIdsAsync(int tvSho /// Season number. /// Episode number. /// A representing the asynchronous operation. - public async Task GetTVShowEpisodeImagesAsync(int tvShowId, int seasonNumber, int episodeNumber) + public Task GetTVShowEpisodeImagesAsync(int tvShowId, int seasonNumber, int episodeNumber) { - return await GetJsonAsync($"/tv/{tvShowId}/season/{seasonNumber}/episode/{episodeNumber}/images") - .ConfigureAwait(false); + return GetJsonAsync($"/tv/{tvShowId}/season/{seasonNumber}/episode/{episodeNumber}/images"); } /// @@ -1958,10 +1850,9 @@ public async Task GetTVShowEpisodeImagesAsync(int tvShowId, /// Season number. /// Episode number. /// A representing the asynchronous operation. - public async Task> GetTVShowEpisodeTranslationsAsync(int tvShowId, int seasonNumber, int episodeNumber) + public Task> GetTVShowEpisodeTranslationsAsync(int tvShowId, int seasonNumber, int episodeNumber) { - return await GetJsonAsync>($"/tv/{tvShowId}/season/{seasonNumber}/episode/{episodeNumber}/translations") - .ConfigureAwait(false); + return GetJsonAsync>($"/tv/{tvShowId}/season/{seasonNumber}/episode/{episodeNumber}/translations"); } /// @@ -1973,7 +1864,7 @@ public async Task> GetTVShowEpisodeTr /// The value of the rating which is expected to be between 0.5 and 10.0. /// A valid session id. /// A representing the asynchronous operation. - public async Task SetTVShowEpisodeRatingAsync(int tvShowId, int seasonNumber, int episodeNumber, double value, string sessionId) + public Task SetTVShowEpisodeRatingAsync(int tvShowId, int seasonNumber, int episodeNumber, double value, string sessionId) { if (string.IsNullOrWhiteSpace(sessionId)) { @@ -1990,8 +1881,7 @@ public async Task SetTVShowEpisodeRatingAsync(int tvShowId, int season value = value, }; - return await PostJsonAsync($"/tv/{tvShowId}/season/{seasonNumber}/episode/{episodeNumber}/rating", parameters, request) - .ConfigureAwait(false); + return PostJsonAsync($"/tv/{tvShowId}/season/{seasonNumber}/episode/{episodeNumber}/rating", parameters, request); } /// @@ -2002,7 +1892,7 @@ public async Task SetTVShowEpisodeRatingAsync(int tvShowId, int season /// The episode number. /// A valid session id. /// A representing the asynchronous operation. - public async Task DeleteTVShowEpisodeRatingAsync(int tvShowId, int seasonNumber, int episodeNumber, string sessionId) + public Task DeleteTVShowEpisodeRatingAsync(int tvShowId, int seasonNumber, int episodeNumber, string sessionId) { if (string.IsNullOrWhiteSpace(sessionId)) { @@ -2014,8 +1904,7 @@ public async Task DeleteTVShowEpisodeRatingAsync(int tvShowId, int sea ["session_id"] = sessionId, }; - return await DeleteJsonAsync($"/tv/{tvShowId}/season/{seasonNumber}/episode/{episodeNumber}/rating", parameters) - .ConfigureAwait(false); + return DeleteJsonAsync($"/tv/{tvShowId}/season/{seasonNumber}/episode/{episodeNumber}/rating", parameters); } /// @@ -2025,10 +1914,9 @@ public async Task DeleteTVShowEpisodeRatingAsync(int tvShowId, int sea /// Season number. /// Episode number. /// A representing the asynchronous operation. - public async Task> GetTVShowEpisodeVideosAsync(int tvShowId, int seasonNumber, int episodeNumber) + public Task> GetTVShowEpisodeVideosAsync(int tvShowId, int seasonNumber, int episodeNumber) { - return await GetJsonAsync>($"/tv/{tvShowId}/season/{seasonNumber}/episode/{episodeNumber}/videos") - .ConfigureAwait(false); + return GetJsonAsync>($"/tv/{tvShowId}/season/{seasonNumber}/episode/{episodeNumber}/videos"); } /// @@ -2048,10 +1936,9 @@ public async Task> GetTVShowEpisodeVideosAsync(int tvShowId, /// /// If of the episode group. /// A representing the asynchronous operation. - public async Task GetTVShowEpisodeGroupsDetailsAsync(string episodeGroupId) + public Task GetTVShowEpisodeGroupsDetailsAsync(string episodeGroupId) { - return await GetJsonAsync($"/tv/episode_group/{episodeGroupId}") - .ConfigureAwait(false); + return GetJsonAsync($"/tv/episode_group/{episodeGroupId}"); } ///