From d72f40fe4159d83440c3362d137901e4c418c4b9 Mon Sep 17 00:00:00 2001 From: Shadowghost Date: Wed, 3 Apr 2024 16:19:13 +0200 Subject: [PATCH] Return 204 on OpenAccess --- Jellyfin.Api/Controllers/PlaylistsController.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Jellyfin.Api/Controllers/PlaylistsController.cs b/Jellyfin.Api/Controllers/PlaylistsController.cs index 567a27412..d6239503c 100644 --- a/Jellyfin.Api/Controllers/PlaylistsController.cs +++ b/Jellyfin.Api/Controllers/PlaylistsController.cs @@ -184,7 +184,8 @@ public class PlaylistsController : BaseJellyfinApiController /// /// The playlist id. /// The user id. - /// Found shares. + /// User permission found. + /// No user permission found but open access. /// Access forbidden. /// Playlist not found. /// @@ -192,6 +193,7 @@ public class PlaylistsController : BaseJellyfinApiController /// [HttpGet("{playlistId}/User/{userId}")] [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status403Forbidden)] [ProducesResponseType(StatusCodes.Status404NotFound)] public ActionResult GetPlaylistUser( @@ -210,7 +212,7 @@ public class PlaylistsController : BaseJellyfinApiController || playlist.Shares.Any(s => s.CanEdit && s.UserId.Equals(callingUserId)) || userId.Equals(callingUserId); - return isPermitted ? playlist.Shares.FirstOrDefault(s => s.UserId.Equals(userId)) : Forbid(); + return isPermitted ? playlist.Shares.FirstOrDefault(s => s.UserId.Equals(userId)) : playlist.OpenAccess ? NoContent() : Forbid(); } ///