Skip to content

Commit

Permalink
Remove unnecessary limit check
Browse files Browse the repository at this point in the history
  • Loading branch information
Nullcaller committed Oct 29, 2024
1 parent 713790c commit 4c7a63b
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/Jellyfin.Plugin.Dlna/ContentDirectory/ControlHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1036,18 +1036,7 @@ private QueryResult<ServerItem> GetLatest(BaseItem parent, InternalItemsQuery qu

if (query.StartIndex > 0)
{
if (items.Length <= query.StartIndex)
{
items = Array.Empty<BaseItem>();
}
else if (query.Limit > 0 && items.Length > limit)
{
items = items[query.StartIndex.Value..(query.StartIndex + query.Limit - 1).Value];
}
else
{
items = items[query.StartIndex.Value..];
}
items = (items.Length <= query.StartIndex) ? Array.Empty<BaseItem>() : items[query.StartIndex.Value..];
}

return ToResult(query.StartIndex, items);
Expand Down

0 comments on commit 4c7a63b

Please sign in to comment.