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