|
|
@ -159,12 +159,12 @@ namespace TMDbLib.Client |
|
|
|
|
|
|
|
public async Task<ImagesWithId> GetMovieImagesAsync(int movieId, CancellationToken cancellationToken = default(CancellationToken)) |
|
|
|
{ |
|
|
|
return await GetMovieImagesAsync(movieId, DefaultLanguage, cancellationToken).ConfigureAwait(false); |
|
|
|
return await GetMovieImagesAsync(movieId, DefaultLanguage, null, cancellationToken).ConfigureAwait(false); |
|
|
|
} |
|
|
|
|
|
|
|
public async Task<ImagesWithId> GetMovieImagesAsync(int movieId, string language, CancellationToken cancellationToken = default(CancellationToken)) |
|
|
|
public async Task<ImagesWithId> GetMovieImagesAsync(int movieId, string language, string includeImageLanguage = null, CancellationToken cancellationToken = default(CancellationToken)) |
|
|
|
{ |
|
|
|
return await GetMovieMethod<ImagesWithId>(movieId, MovieMethods.Images, language: language, cancellationToken: cancellationToken).ConfigureAwait(false); |
|
|
|
return await GetMovieMethod<ImagesWithId>(movieId, MovieMethods.Images, language: language, includeImageLanguage: includeImageLanguage, cancellationToken: cancellationToken).ConfigureAwait(false); |
|
|
|
} |
|
|
|
|
|
|
|
public async Task<KeywordsContainer> GetMovieKeywordsAsync(int movieId, CancellationToken cancellationToken = default(CancellationToken)) |
|
|
@ -172,7 +172,7 @@ namespace TMDbLib.Client |
|
|
|
return await GetMovieMethod<KeywordsContainer>(movieId, MovieMethods.Keywords, cancellationToken: cancellationToken).ConfigureAwait(false); |
|
|
|
} |
|
|
|
|
|
|
|
public async Task<Movie> GetMovieLatestAsync( CancellationToken cancellationToken = default(CancellationToken)) |
|
|
|
public async Task<Movie> GetMovieLatestAsync(CancellationToken cancellationToken = default(CancellationToken)) |
|
|
|
{ |
|
|
|
RestRequest req = _client.Create("movie/latest"); |
|
|
|
RestResponse<Movie> resp = await req.ExecuteGet<Movie>(cancellationToken).ConfigureAwait(false); |
|
|
@ -208,7 +208,7 @@ namespace TMDbLib.Client |
|
|
|
|
|
|
|
private async Task<T> GetMovieMethod<T>(int movieId, MovieMethods movieMethod, string dateFormat = null, |
|
|
|
string country = null, |
|
|
|
string language = null, int page = 0, DateTime? startDate = null, DateTime? endDate = null, CancellationToken cancellationToken = default(CancellationToken)) where T : new() |
|
|
|
string language = null, string includeImageLanguage = null, int page = 0, DateTime? startDate = null, DateTime? endDate = null, CancellationToken cancellationToken = default(CancellationToken)) where T : new() |
|
|
|
{ |
|
|
|
RestRequest req = _client.Create("movie/{movieId}/{method}"); |
|
|
|
req.AddUrlSegment("movieId", movieId.ToString(CultureInfo.InvariantCulture)); |
|
|
@ -220,6 +220,9 @@ namespace TMDbLib.Client |
|
|
|
if (!string.IsNullOrWhiteSpace(language)) |
|
|
|
req.AddParameter("language", language); |
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(includeImageLanguage)) |
|
|
|
req.AddParameter("include_image_language", includeImageLanguage); |
|
|
|
|
|
|
|
if (page >= 1) |
|
|
|
req.AddParameter("page", page.ToString()); |
|
|
|
if (startDate.HasValue) |
|
|
@ -382,5 +385,4 @@ namespace TMDbLib.Client |
|
|
|
return item.StatusCode == 1 || item.StatusCode == 12; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |