From c831af2fe23b6400ea6ee9a57b938a594b654ad5 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Wed, 15 May 2024 17:49:29 +0200 Subject: [PATCH] Pass User instead of UserId inside LatestItemsQuery --- Emby.Server.Implementations/Library/UserViewManager.cs | 4 +--- Jellyfin.Api/Controllers/UserLibraryController.cs | 2 +- MediaBrowser.Model/Querying/LatestItemsQuery.cs | 3 ++- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Emby.Server.Implementations/Library/UserViewManager.cs b/Emby.Server.Implementations/Library/UserViewManager.cs index d9a559014..466f83360 100644 --- a/Emby.Server.Implementations/Library/UserViewManager.cs +++ b/Emby.Server.Implementations/Library/UserViewManager.cs @@ -207,9 +207,7 @@ namespace Emby.Server.Implementations.Library public List>> GetLatestItems(LatestItemsQuery request, DtoOptions options) { - var user = _userManager.GetUserById(request.UserId); - - var libraryItems = GetItemsForLatestItems(user, request, options); + var libraryItems = GetItemsForLatestItems(request.User, request, options); var list = new List>>(); diff --git a/Jellyfin.Api/Controllers/UserLibraryController.cs b/Jellyfin.Api/Controllers/UserLibraryController.cs index 421f1bfb5..e7bf71727 100644 --- a/Jellyfin.Api/Controllers/UserLibraryController.cs +++ b/Jellyfin.Api/Controllers/UserLibraryController.cs @@ -560,7 +560,7 @@ public class UserLibraryController : BaseJellyfinApiController IsPlayed = isPlayed, Limit = limit, ParentId = parentId ?? Guid.Empty, - UserId = requestUserId, + User = user, }, dtoOptions); diff --git a/MediaBrowser.Model/Querying/LatestItemsQuery.cs b/MediaBrowser.Model/Querying/LatestItemsQuery.cs index d2d9f1f9a..251ff5d68 100644 --- a/MediaBrowser.Model/Querying/LatestItemsQuery.cs +++ b/MediaBrowser.Model/Querying/LatestItemsQuery.cs @@ -2,6 +2,7 @@ #pragma warning disable CS1591 using System; +using Jellyfin.Data.Entities; using Jellyfin.Data.Enums; using MediaBrowser.Model.Entities; @@ -18,7 +19,7 @@ namespace MediaBrowser.Model.Querying /// Gets or sets the user to localize search results for. /// /// The user id. - public Guid UserId { get; set; } + public User User { get; set; } /// /// Gets or sets the parent id.