diff options
| author | Claus Vium <cvium@users.noreply.github.com> | 2020-12-04 13:50:44 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-04 13:50:44 +0100 |
| commit | dca3f62ff85ba62af95831848718e9764d163306 (patch) | |
| tree | 5be2338b7ec18013fb18feb3325d3228b3e5da59 /Jellyfin.Api/Controllers/SuggestionsController.cs | |
| parent | eed1a40b1935e00e04f6b27c7d307bf110b83b31 (diff) | |
| parent | 9afd19b06e025992ee5159a08d7af8bd736a828e (diff) | |
Merge branch 'master' into PlugsVersionNumberFix
Diffstat (limited to 'Jellyfin.Api/Controllers/SuggestionsController.cs')
| -rw-r--r-- | Jellyfin.Api/Controllers/SuggestionsController.cs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Jellyfin.Api/Controllers/SuggestionsController.cs b/Jellyfin.Api/Controllers/SuggestionsController.cs index ad64adfba..9f1dec712 100644 --- a/Jellyfin.Api/Controllers/SuggestionsController.cs +++ b/Jellyfin.Api/Controllers/SuggestionsController.cs @@ -1,9 +1,10 @@ -using System; +using System; using System.ComponentModel.DataAnnotations; 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, |
