aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers
diff options
context:
space:
mode:
authorJPVenson <6794763+JPVenson@users.noreply.github.com>2024-10-09 10:41:54 +0000
committerJPVenson <6794763+JPVenson@users.noreply.github.com>2024-10-09 10:41:54 +0000
commit2014fa56b8ab0b0aec0b31ae0d2d9e2fce02ee53 (patch)
tree70f34a555e9c0660b81dacc16b1ceca0fe3158e2 /Jellyfin.Api/Controllers
parentb09a41ad1f05664a6099734cb44e068f993a8e93 (diff)
Ported new Item Repository architecture
Diffstat (limited to 'Jellyfin.Api/Controllers')
-rw-r--r--Jellyfin.Api/Controllers/InstantMixController.cs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Jellyfin.Api/Controllers/InstantMixController.cs b/Jellyfin.Api/Controllers/InstantMixController.cs
index dcbacf1d7..e9dda19ca 100644
--- a/Jellyfin.Api/Controllers/InstantMixController.cs
+++ b/Jellyfin.Api/Controllers/InstantMixController.cs
@@ -1,6 +1,8 @@
using System;
using System.Collections.Generic;
+using System.Collections.Immutable;
using System.ComponentModel.DataAnnotations;
+using System.Linq;
using Jellyfin.Api.Extensions;
using Jellyfin.Api.Helpers;
using Jellyfin.Api.ModelBinders;
@@ -389,7 +391,7 @@ public class InstantMixController : BaseJellyfinApiController
return GetResult(items, user, limit, dtoOptions);
}
- private QueryResult<BaseItemDto> GetResult(List<BaseItem> items, User? user, int? limit, DtoOptions dtoOptions)
+ private QueryResult<BaseItemDto> GetResult(IReadOnlyList<BaseItem> items, User? user, int? limit, DtoOptions dtoOptions)
{
var list = items;
@@ -397,7 +399,7 @@ public class InstantMixController : BaseJellyfinApiController
if (limit.HasValue && limit < list.Count)
{
- list = list.GetRange(0, limit.Value);
+ list = list.Take(limit.Value).ToImmutableArray();
}
var returnList = _dtoService.GetBaseItemDtos(list, dtoOptions, user);