mirror of
https://github.com/jellyfin/TMDbLib.git
synced 2024-11-26 23:30:23 +00:00
Merge pull request #426 from LordMike/feature/422-discovermovie-missing-with_release_t
422 DiscoverMovie missing 'with_release_type' parameter
This commit is contained in:
commit
6420364178
@ -4,9 +4,10 @@ using System.Linq;
|
||||
using TMDbLib.Objects.Companies;
|
||||
using TMDbLib.Objects.General;
|
||||
using TMDbLib.Client;
|
||||
using TMDbLib.Objects.Movies;
|
||||
using TMDbLib.Objects.Search;
|
||||
using TMDbLib.Objects.TvShows;
|
||||
using TMDbLib.Utilities;
|
||||
using Cast = TMDbLib.Objects.TvShows.Cast;
|
||||
|
||||
namespace TMDbLib.Objects.Discover
|
||||
{
|
||||
@ -437,5 +438,23 @@ namespace TMDbLib.Objects.Discover
|
||||
Parameters["with_original_language"] = language;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that only movies with all the given release types will be returned.
|
||||
/// </summary>
|
||||
public DiscoverMovie WithAllOfReleaseTypes(params ReleaseDateType[] releaseTypes)
|
||||
{
|
||||
Parameters["with_release_type"] = string.Join(",", releaseTypes.Select(s => ((int)s).ToString()));
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that only movies with the given release types will be returned.
|
||||
/// </summary>
|
||||
public DiscoverMovie WithAnyOfReleaseTypes(params ReleaseDateType[] releaseTypes)
|
||||
{
|
||||
Parameters["with_release_type"] = string.Join("|", releaseTypes.Select(s => ((int)s).ToString()));
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ using TMDbLibTests.Helpers;
|
||||
using TMDbLibTests.JsonHelpers;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using TMDbLib.Objects.Movies;
|
||||
|
||||
namespace TMDbLibTests
|
||||
{
|
||||
@ -53,6 +54,15 @@ namespace TMDbLibTests
|
||||
await TestHelpers.SearchPagesAsync(i => query.Query(i));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task TestDiscoverMoviesReleaseTypeAsync()
|
||||
{
|
||||
DiscoverMovie query = TMDbClient.DiscoverMoviesAsync()
|
||||
.WithAnyOfReleaseTypes(ReleaseDateType.Premiere);
|
||||
|
||||
await TestHelpers.SearchPagesAsync(i => query.Query(i));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task TestDiscoverMoviesLanguageAsync()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user