aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShadowghost <Ghost_of_Stone@web.de>2024-04-03 16:32:25 +0200
committerShadowghost <Ghost_of_Stone@web.de>2024-04-03 16:32:25 +0200
commit5396b616bf2d7e387bc20539eeae03e841f60c01 (patch)
tree6e76096f5e6d14a28d10108a3cd07e2e8c427eda
parent247ec19de4945f4d7ab64d4a8772b72759e3d2b7 (diff)
Fixup
-rw-r--r--Jellyfin.Api/Controllers/PlaylistsController.cs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Jellyfin.Api/Controllers/PlaylistsController.cs b/Jellyfin.Api/Controllers/PlaylistsController.cs
index 54b2261ab..01c1c578d 100644
--- a/Jellyfin.Api/Controllers/PlaylistsController.cs
+++ b/Jellyfin.Api/Controllers/PlaylistsController.cs
@@ -208,11 +208,12 @@ public class PlaylistsController : BaseJellyfinApiController
return NotFound("Playlist not found");
}
+ var userPermission = playlist.Shares.FirstOrDefault(s => s.UserId.Equals(userId));
var isPermitted = playlist.OwnerUserId.Equals(callingUserId)
|| playlist.Shares.Any(s => s.CanEdit && s.UserId.Equals(callingUserId))
|| userId.Equals(callingUserId);
- return isPermitted ? playlist.Shares.FirstOrDefault(s => s.UserId.Equals(userId)) : playlist.OpenAccess ? NoContent() : Forbid();
+ return isPermitted ? userPermission is not null ? userPermission : NotFound("User permissions not found") : playlist.OpenAccess ? NoContent() : Forbid();
}
/// <summary>