From 84878f537cfa12149b8f4d308446e165fae78d5b Mon Sep 17 00:00:00 2001
From: Joe Rogers <1337joe@gmail.com>
Date: Sat, 21 May 2022 13:11:26 +0200
Subject: [PATCH] Support searching with tv program filters
---
Jellyfin.Api/Controllers/ItemsController.cs | 72 +++++++++++++------
.../Controllers/TrailersController.cs | 15 ++++
2 files changed, 66 insertions(+), 21 deletions(-)
diff --git a/Jellyfin.Api/Controllers/ItemsController.cs b/Jellyfin.Api/Controllers/ItemsController.cs
index 2794a06f30..58caae9f85 100644
--- a/Jellyfin.Api/Controllers/ItemsController.cs
+++ b/Jellyfin.Api/Controllers/ItemsController.cs
@@ -89,6 +89,11 @@ namespace Jellyfin.Api.Controllers
/// Optional filter by items that have an imdb id or not.
/// Optional filter by items that have a tmdb id or not.
/// Optional filter by items that have a tvdb id or not.
+ /// Optional filter for live tv movies.
+ /// Optional filter for live tv series.
+ /// Optional filter for live tv news.
+ /// Optional filter for live tv kids.
+ /// Optional filter for live tv sports.
/// Optional. If specified, results will be filtered by excluding item ids. This allows multiple, comma delimited.
/// Optional. The record index to start at. All items with a lower index will be dropped from the results.
/// Optional. The maximum number of records to return.
@@ -173,6 +178,11 @@ namespace Jellyfin.Api.Controllers
[FromQuery] bool? hasImdbId,
[FromQuery] bool? hasTmdbId,
[FromQuery] bool? hasTvdbId,
+ [FromQuery] bool? isMovie,
+ [FromQuery] bool? isSeries,
+ [FromQuery] bool? isNews,
+ [FromQuery] bool? isKids,
+ [FromQuery] bool? isSports,
[FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] Guid[] excludeItemIds,
[FromQuery] int? startIndex,
[FromQuery] int? limit,
@@ -316,6 +326,11 @@ namespace Jellyfin.Api.Controllers
Is3D = is3D,
HasTvdbId = hasTvdbId,
HasTmdbId = hasTmdbId,
+ IsMovie = isMovie,
+ IsSeries = isSeries,
+ IsNews = isNews,
+ IsKids = isKids,
+ IsSports = isSports,
HasOverview = hasOverview,
HasOfficialRating = hasOfficialRating,
HasParentalRating = hasParentalRating,
@@ -515,8 +530,8 @@ namespace Jellyfin.Api.Controllers
/// Optional filter by items that have or do not have a parental rating.
/// Optional filter by items that are HD or not.
/// Optional filter by items that are 4K or not.
- /// Optional. If specified, results will be filtered based on LocationType. This allows multiple, comma delimeted.
- /// Optional. If specified, results will be filtered based on the LocationType. This allows multiple, comma delimeted.
+ /// Optional. If specified, results will be filtered based on LocationType. This allows multiple, comma delimited.
+ /// Optional. If specified, results will be filtered based on the LocationType. This allows multiple, comma delimited.
/// Optional filter by items that are missing episodes or not.
/// Optional filter by items that are unaired episodes or not.
/// Optional filter by minimum community rating.
@@ -529,42 +544,47 @@ namespace Jellyfin.Api.Controllers
/// Optional filter by items that have an imdb id or not.
/// Optional filter by items that have a tmdb id or not.
/// Optional filter by items that have a tvdb id or not.
- /// Optional. If specified, results will be filtered by exxcluding item ids. This allows multiple, comma delimeted.
+ /// Optional filter for live tv movies.
+ /// Optional filter for live tv series.
+ /// Optional filter for live tv news.
+ /// Optional filter for live tv kids.
+ /// Optional filter for live tv sports.
+ /// Optional. If specified, results will be filtered by excluding item ids. This allows multiple, comma delimited.
/// Optional. The record index to start at. All items with a lower index will be dropped from the results.
/// Optional. The maximum number of records to return.
/// When searching within folders, this determines whether or not the search will be recursive. true/false.
/// Optional. Filter based on a search term.
/// Sort Order - Ascending,Descending.
/// Specify this to localize the search to a specific item or folder. Omit to use the root.
- /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimeted. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.
- /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimeted.
- /// Optional. If specified, results will be filtered based on the item type. This allows multiple, comma delimeted.
- /// Optional. Specify additional filters to apply. This allows multiple, comma delimeted. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes.
+ /// Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines.
+ /// Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.
+ /// Optional. If specified, results will be filtered based on the item type. This allows multiple, comma delimited.
+ /// Optional. Specify additional filters to apply. This allows multiple, comma delimited. Options: IsFolder, IsNotFolder, IsUnplayed, IsPlayed, IsFavorite, IsResumable, Likes, Dislikes.
/// Optional filter by items that are marked as favorite, or not.
/// Optional filter by MediaType. Allows multiple, comma delimited.
/// Optional. If specified, results will be filtered based on those containing image types. This allows multiple, comma delimited.
- /// Optional. Specify one or more sort orders, comma delimeted. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.
+ /// Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.
/// Optional filter by items that are played, or not.
- /// Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimeted.
- /// Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimeted.
- /// Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimeted.
- /// Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimeted.
+ /// Optional. If specified, results will be filtered based on genre. This allows multiple, pipe delimited.
+ /// Optional. If specified, results will be filtered based on OfficialRating. This allows multiple, pipe delimited.
+ /// Optional. If specified, results will be filtered based on tag. This allows multiple, pipe delimited.
+ /// Optional. If specified, results will be filtered based on production year. This allows multiple, comma delimited.
/// Optional, include user data.
/// Optional, the max number of images to return, per image type.
/// Optional. The image types to include in the output.
/// Optional. If specified, results will be filtered to include only those containing the specified person.
/// Optional. If specified, results will be filtered to include only those containing the specified person id.
/// Optional. If specified, along with Person, results will be filtered to include only those containing the specified person and PersonType. Allows multiple, comma-delimited.
- /// Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimeted.
- /// Optional. If specified, results will be filtered based on artists. This allows multiple, pipe delimeted.
- /// Optional. If specified, results will be filtered based on artist id. This allows multiple, pipe delimeted.
+ /// Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimited.
+ /// Optional. If specified, results will be filtered based on artists. This allows multiple, pipe delimited.
+ /// Optional. If specified, results will be filtered based on artist id. This allows multiple, pipe delimited.
/// Optional. If specified, results will be filtered to include only those containing the specified artist id.
/// Optional. If specified, results will be filtered to include only those containing the specified album artist id.
/// Optional. If specified, results will be filtered to include only those containing the specified contributing artist id.
- /// Optional. If specified, results will be filtered based on album. This allows multiple, pipe delimeted.
- /// Optional. If specified, results will be filtered based on album id. This allows multiple, pipe delimeted.
+ /// Optional. If specified, results will be filtered based on album. This allows multiple, pipe delimited.
+ /// Optional. If specified, results will be filtered based on album id. This allows multiple, pipe delimited.
/// Optional. If specific items are needed, specify a list of item id's to retrieve. This allows multiple, comma delimited.
- /// Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimeted.
+ /// Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma delimited.
/// Optional filter by minimum official rating (PG, PG-13, TV-MA, etc).
/// Optional filter by items that are locked.
/// Optional filter by items that are placeholders.
@@ -575,12 +595,12 @@ namespace Jellyfin.Api.Controllers
/// Optional. Filter by the maximum width of the item.
/// Optional. Filter by the maximum height of the item.
/// Optional filter by items that are 3D, or not.
- /// Optional filter by Series Status. Allows multiple, comma delimeted.
+ /// Optional filter by Series Status. Allows multiple, comma delimited.
/// Optional filter by items whose name is sorted equally or greater than a given input string.
/// Optional filter by items whose name is sorted equally than a given input string.
/// Optional filter by items whose name is equally or lesser than a given input string.
- /// Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimeted.
- /// Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimeted.
+ /// Optional. If specified, results will be filtered based on studio id. This allows multiple, pipe delimited.
+ /// Optional. If specified, results will be filtered based on genre id. This allows multiple, pipe delimited.
/// Optional. Enable the total record count.
/// Optional, include image information in output.
/// A with the items.
@@ -613,6 +633,11 @@ namespace Jellyfin.Api.Controllers
[FromQuery] bool? hasImdbId,
[FromQuery] bool? hasTmdbId,
[FromQuery] bool? hasTvdbId,
+ [FromQuery] bool? isMovie,
+ [FromQuery] bool? isSeries,
+ [FromQuery] bool? isNews,
+ [FromQuery] bool? isKids,
+ [FromQuery] bool? isSports,
[FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] Guid[] excludeItemIds,
[FromQuery] int? startIndex,
[FromQuery] int? limit,
@@ -695,6 +720,11 @@ namespace Jellyfin.Api.Controllers
hasImdbId,
hasTmdbId,
hasTvdbId,
+ isMovie,
+ isSeries,
+ isNews,
+ isKids,
+ isSports,
excludeItemIds,
startIndex,
limit,
diff --git a/Jellyfin.Api/Controllers/TrailersController.cs b/Jellyfin.Api/Controllers/TrailersController.cs
index 5cb7468b24..790d6e64d8 100644
--- a/Jellyfin.Api/Controllers/TrailersController.cs
+++ b/Jellyfin.Api/Controllers/TrailersController.cs
@@ -57,6 +57,11 @@ namespace Jellyfin.Api.Controllers
/// Optional filter by items that have an imdb id or not.
/// Optional filter by items that have a tmdb id or not.
/// Optional filter by items that have a tvdb id or not.
+ /// Optional filter for live tv movies.
+ /// Optional filter for live tv series.
+ /// Optional filter for live tv news.
+ /// Optional filter for live tv kids.
+ /// Optional filter for live tv sports.
/// Optional. If specified, results will be filtered by excluding item ids. This allows multiple, comma delimited.
/// Optional. The record index to start at. All items with a lower index will be dropped from the results.
/// Optional. The maximum number of records to return.
@@ -140,6 +145,11 @@ namespace Jellyfin.Api.Controllers
[FromQuery] bool? hasImdbId,
[FromQuery] bool? hasTmdbId,
[FromQuery] bool? hasTvdbId,
+ [FromQuery] bool? isMovie,
+ [FromQuery] bool? isSeries,
+ [FromQuery] bool? isNews,
+ [FromQuery] bool? isKids,
+ [FromQuery] bool? isSports,
[FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] Guid[] excludeItemIds,
[FromQuery] int? startIndex,
[FromQuery] int? limit,
@@ -224,6 +234,11 @@ namespace Jellyfin.Api.Controllers
hasImdbId,
hasTmdbId,
hasTvdbId,
+ isMovie,
+ isSeries,
+ isNews,
+ isKids,
+ isSports,
excludeItemIds,
startIndex,
limit,