diff options
| author | Shadowghost <Ghost_of_Stone@web.de> | 2024-04-03 16:32:25 +0200 |
|---|---|---|
| committer | Shadowghost <Ghost_of_Stone@web.de> | 2024-04-03 16:32:25 +0200 |
| commit | 5396b616bf2d7e387bc20539eeae03e841f60c01 (patch) | |
| tree | 6e76096f5e6d14a28d10108a3cd07e2e8c427eda | |
| parent | 247ec19de4945f4d7ab64d4a8772b72759e3d2b7 (diff) | |
Fixup
| -rw-r--r-- | Jellyfin.Api/Controllers/PlaylistsController.cs | 3 |
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> |
