diff options
| author | BaronGreenback <jimcartlidge@yahoo.co.uk> | 2020-11-21 00:35:53 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-21 00:35:53 +0000 |
| commit | 7a6063ed41bb75ce087ceb38279426fed025b1ff (patch) | |
| tree | a5261bee96f1eed0825944b7c8d7318b2d93ce8d /Jellyfin.Api/Controllers/SuggestionsController.cs | |
| parent | 9a9b2bfb2ea6a39d1a46f16355b42d930b307177 (diff) | |
| parent | d2cef78db3c6f5c1063f8205ed5309f5243be66b (diff) | |
Merge branch 'master' into NetworkPR2
Diffstat (limited to 'Jellyfin.Api/Controllers/SuggestionsController.cs')
| -rw-r--r-- | Jellyfin.Api/Controllers/SuggestionsController.cs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Jellyfin.Api/Controllers/SuggestionsController.cs b/Jellyfin.Api/Controllers/SuggestionsController.cs index ad64adfba..69292186e 100644 --- a/Jellyfin.Api/Controllers/SuggestionsController.cs +++ b/Jellyfin.Api/Controllers/SuggestionsController.cs @@ -4,6 +4,7 @@ using System.Linq; using Jellyfin.Api.Constants; using Jellyfin.Api.Extensions; using Jellyfin.Api.Helpers; +using Jellyfin.Api.ModelBinders; using Jellyfin.Data.Enums; using MediaBrowser.Controller.Dto; using MediaBrowser.Controller.Entities; @@ -58,8 +59,8 @@ namespace Jellyfin.Api.Controllers [ProducesResponseType(StatusCodes.Status200OK)] public ActionResult<QueryResult<BaseItemDto>> GetSuggestions( [FromRoute, Required] Guid userId, - [FromQuery] string? mediaType, - [FromQuery] string? type, + [FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] string[] mediaType, + [FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] string[] type, [FromQuery] int? startIndex, [FromQuery] int? limit, [FromQuery] bool enableTotalRecordCount = false) @@ -70,8 +71,8 @@ namespace Jellyfin.Api.Controllers var result = _libraryManager.GetItemsResult(new InternalItemsQuery(user) { OrderBy = new[] { ItemSortBy.Random }.Select(i => new ValueTuple<string, SortOrder>(i, SortOrder.Descending)).ToArray(), - MediaTypes = RequestHelpers.Split(mediaType!, ',', true), - IncludeItemTypes = RequestHelpers.Split(type!, ',', true), + MediaTypes = mediaType, + IncludeItemTypes = type, IsVirtualItem = false, StartIndex = startIndex, Limit = limit, |
