Pass User instead of UserId inside LatestItemsQuery

This commit is contained in:
Bond_009 2024-05-15 17:49:29 +02:00
parent 21f1813d82
commit c831af2fe2
3 changed files with 4 additions and 5 deletions

View File

@ -207,9 +207,7 @@ namespace Emby.Server.Implementations.Library
public List<Tuple<BaseItem, List<BaseItem>>> GetLatestItems(LatestItemsQuery request, DtoOptions options) public List<Tuple<BaseItem, List<BaseItem>>> GetLatestItems(LatestItemsQuery request, DtoOptions options)
{ {
var user = _userManager.GetUserById(request.UserId); var libraryItems = GetItemsForLatestItems(request.User, request, options);
var libraryItems = GetItemsForLatestItems(user, request, options);
var list = new List<Tuple<BaseItem, List<BaseItem>>>(); var list = new List<Tuple<BaseItem, List<BaseItem>>>();

View File

@ -560,7 +560,7 @@ public class UserLibraryController : BaseJellyfinApiController
IsPlayed = isPlayed, IsPlayed = isPlayed,
Limit = limit, Limit = limit,
ParentId = parentId ?? Guid.Empty, ParentId = parentId ?? Guid.Empty,
UserId = requestUserId, User = user,
}, },
dtoOptions); dtoOptions);

View File

@ -2,6 +2,7 @@
#pragma warning disable CS1591 #pragma warning disable CS1591
using System; using System;
using Jellyfin.Data.Entities;
using Jellyfin.Data.Enums; using Jellyfin.Data.Enums;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
@ -18,7 +19,7 @@ namespace MediaBrowser.Model.Querying
/// Gets or sets the user to localize search results for. /// Gets or sets the user to localize search results for.
/// </summary> /// </summary>
/// <value>The user id.</value> /// <value>The user id.</value>
public Guid UserId { get; set; } public User User { get; set; }
/// <summary> /// <summary>
/// Gets or sets the parent id. /// Gets or sets the parent id.