瀏覽代碼

Use RequestHelpers.Split

David 5 年之前
父節點
當前提交
33de0ac108
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      Jellyfin.Api/Controllers/SuggestionsController.cs

+ 3 - 2
Jellyfin.Api/Controllers/SuggestionsController.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Linq;
 using Jellyfin.Api.Extensions;
+using Jellyfin.Api.Helpers;
 using MediaBrowser.Controller.Dto;
 using MediaBrowser.Controller.Entities;
 using MediaBrowser.Controller.Library;
@@ -64,8 +65,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 = (mediaType ?? string.Empty).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries),
-                IncludeItemTypes = (type ?? string.Empty).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries),
+                MediaTypes = RequestHelpers.Split(mediaType!, ',', true),
+                IncludeItemTypes = RequestHelpers.Split(type!, ',', true),
                 IsVirtualItem = false,
                 StartIndex = startIndex,
                 Limit = limit,