v2.0.0-preview.1
Pre-release
Pre-release
·
9 commits
to main
since this release
Breaking changes:
- The default values for
Language
,ImageFallbackLanguages
andIsAdultIncluded
options has been changed tonull
. - The
IsAdultIncluded
option is now nullable.
To keep the previous behavior, you should set the following values:
var options = new TheMovieDatabaseOptions
{
// ...
Language = "en-US",
ImageFallbackLanguages = "en,null",
IsAdultIncluded = false,
};
- The result classes now inherit from the
Response
class.
If you set the options.UseEnsureSuccessStatusCode
to false
(see new features below), you can check for errors via the Success
, StatusCode
and StatusMessage
properties.
Important
This means some classes that previously inherited from another base class (for simplicity), now implements the previous base class properties explicitly.
New features:
- A new
SearchMoviesAsync
overload has been added:
var search = new NewSearchMovie
{
Query = "three colors",
PrimaryReleaseYear = 1994,
// ...
};
var result = await service.SearchMoviesAsync(search);
- A new
SearchTVShowsAsync
overload has been added:
var search = new NewSearchTVShow
{
Query = "frasier",
FirstAirDateYear = 1993,
// ...
};
var result = await service.SearchTVShowsAsync(search);
- You can now set the
Language
(or override the 'options.Language') per request:
var search = new NewSearchMovie
{
// ...
// This overrides the 'options.Language' if exists.
Language = "fr",
// ...
};
- You can now set your user-agent via the
ProductInformation
option:
var options = new TheMovieDatabaseOptions
{
// ...
// Overrides the default request headers if exists.
ProductInformation = new ProductHeaderValue("your-app-name", "your-app-version"),
};
- You can now disable the
EnsureSuccessStatusCode
via theUseEnsureSuccessStatusCode
option:
var options = new TheMovieDatabaseOptions
{
// ...
// This option is set to 'true' by default.
UseEnsureSuccessStatusCode = false,
};