aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/UserViewsController.cs
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2024-05-15 18:12:42 +0200
committerBond_009 <bond.009@outlook.com>2024-08-05 17:17:57 +0200
commit09f447751044f961446aab6b7d825a241398933d (patch)
treeb5f2bf1f8d6ccc27b4ef6b8525fd47c572f680e2 /Jellyfin.Api/Controllers/UserViewsController.cs
parentc680dbb53ecd5d4dc2a5efe00f9bd92761283228 (diff)
Replace UserId with User in UserViewQuery
Diffstat (limited to 'Jellyfin.Api/Controllers/UserViewsController.cs')
-rw-r--r--Jellyfin.Api/Controllers/UserViewsController.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Jellyfin.Api/Controllers/UserViewsController.cs b/Jellyfin.Api/Controllers/UserViewsController.cs
index 01da50d02..e24f78a88 100644
--- a/Jellyfin.Api/Controllers/UserViewsController.cs
+++ b/Jellyfin.Api/Controllers/UserViewsController.cs
@@ -8,6 +8,7 @@ using Jellyfin.Api.Helpers;
using Jellyfin.Api.ModelBinders;
using Jellyfin.Api.Models.UserViewDtos;
using Jellyfin.Data.Enums;
+using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
@@ -69,8 +70,9 @@ public class UserViewsController : BaseJellyfinApiController
[FromQuery] bool includeHidden = false)
{
userId = RequestHelpers.GetUserId(User, userId);
+ var user = _userManager.GetUserById(userId.Value) ?? throw new ResourceNotFoundException();
- var query = new UserViewQuery { UserId = userId.Value, IncludeHidden = includeHidden };
+ var query = new UserViewQuery { User = user, IncludeHidden = includeHidden };
if (includeExternalContent.HasValue)
{
@@ -87,8 +89,6 @@ public class UserViewsController : BaseJellyfinApiController
var dtoOptions = new DtoOptions().AddClientFields(User);
dtoOptions.Fields = [..dtoOptions.Fields, ItemFields.PrimaryImageAspectRatio, ItemFields.DisplayPreferencesId];
- var user = _userManager.GetUserById(userId.Value);
-
var dtos = Array.ConvertAll(folders, i => _dtoService.GetBaseItemDto(i, dtoOptions, user));
return new QueryResult<BaseItemDto>(dtos);