Skip to content

Commit

Permalink
Merge pull request #437 from angyanmark/feature/add-discover-filters
Browse files Browse the repository at this point in the history
Add discover filters
  • Loading branch information
cvium authored Sep 16, 2023
2 parents 863c5b5 + 10b6058 commit dac135a
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
18 changes: 18 additions & 0 deletions TMDbLib/Objects/Discover/DiscoverMovie.cs
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,24 @@ public DiscoverMovie WhereReleaseDateIsBefore(DateTime date)
return this;
}

/// <summary>
/// Only include movies that are equal to, or have a runtime higher than this value. Expected value is an integer (minutes).
/// </summary>
public DiscoverMovie WhereRuntimeIsAtLeast(int minutes)
{
Parameters["with_runtime.gte"] = minutes.ToString();
return this;
}

/// <summary>
/// Only include movies that are equal to, or have a runtime lower than this value. Expected value is an integer (minutes).
/// </summary>
public DiscoverMovie WhereRuntimeIsAtMost(int minutes)
{
Parameters["with_runtime.lte"] = minutes.ToString();
return this;
}

/// <summary>
/// Filter movies by their vote average and only include those that have an average rating that is equal to or higher than the specified value. Expected value is a float.
/// </summary>
Expand Down
18 changes: 18 additions & 0 deletions TMDbLib/Objects/Discover/DiscoverTv.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,15 @@ public DiscoverTv WhereVoteAverageIsAtLeast(double score)
return this;
}

/// <summary>
/// Only include TV shows that are equal to, or have a lower average rating than this value. Expected value is a float.
/// </summary>
public DiscoverTv WhereVoteAverageIsAtMost(double score)
{
Parameters["vote_average.lte"] = score.ToString();
return this;
}

/// <summary>
/// Only include TV shows that are equal to, or have a vote count higher than this value. Expected value is an integer.
/// </summary>
Expand All @@ -134,6 +143,15 @@ public DiscoverTv WhereVoteCountIsAtLeast(int count)
return this;
}

/// <summary>
/// Only include TV shows that are equal to, or have a vote count lower than this value. Expected value is an integer.
/// </summary>
public DiscoverTv WhereVoteCountIsAtMost(int count)
{
Parameters["vote_count.lte"] = count.ToString();
return this;
}

/// <summary>
/// Specifies which language to use for translatable fields
/// </summary>
Expand Down

0 comments on commit dac135a

Please sign in to comment.