aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/ItemsController.cs
diff options
context:
space:
mode:
authorShadowghost <Ghost_of_Stone@web.de>2023-02-20 11:58:14 +0100
committerShadowghost <Ghost_of_Stone@web.de>2023-02-20 11:58:14 +0100
commitc5a363a007b98e7a680bb2a95d9bd49a7dced8f2 (patch)
treea03167485dba1c034b3a9f8d5ec92661f1322a0c /Jellyfin.Api/Controllers/ItemsController.cs
parentaf7acc000c961312bd4a2d061dc74c64c0e3647a (diff)
parent720852f7087e32053407cd849470d3f13f57159c (diff)
Merge branch 'master' into network-rewrite
Diffstat (limited to 'Jellyfin.Api/Controllers/ItemsController.cs')
-rw-r--r--Jellyfin.Api/Controllers/ItemsController.cs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Jellyfin.Api/Controllers/ItemsController.cs b/Jellyfin.Api/Controllers/ItemsController.cs
index 99366e80c..728e62810 100644
--- a/Jellyfin.Api/Controllers/ItemsController.cs
+++ b/Jellyfin.Api/Controllers/ItemsController.cs
@@ -240,7 +240,8 @@ public class ItemsController : BaseJellyfinApiController
{
var isApiKey = User.GetIsApiKey();
// if api key is used (auth.IsApiKey == true), then `user` will be null throughout this method
- var user = !isApiKey && userId.HasValue && !userId.Value.Equals(default)
+ userId = RequestHelpers.GetUserId(User, userId);
+ var user = !isApiKey && !userId.Value.Equals(default)
? _userManager.GetUserById(userId.Value) ?? throw new ResourceNotFoundException()
: null;