From 51e2faa448624a334128042cdca1e592ec97240e Mon Sep 17 00:00:00 2001 From: Shadowghost Date: Wed, 3 Apr 2024 20:06:57 +0200 Subject: [PATCH] Apply review suggestions --- Jellyfin.Api/Controllers/PlaylistsController.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Jellyfin.Api/Controllers/PlaylistsController.cs b/Jellyfin.Api/Controllers/PlaylistsController.cs index d167d996c..ca90d2a6d 100644 --- a/Jellyfin.Api/Controllers/PlaylistsController.cs +++ b/Jellyfin.Api/Controllers/PlaylistsController.cs @@ -113,7 +113,7 @@ public class PlaylistsController : BaseJellyfinApiController /// The task result contains an indicating success. /// [HttpPost("{playlistId}")] - [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status403Forbidden)] [ProducesResponseType(StatusCodes.Status404NotFound)] public async Task UpdatePlaylist( @@ -185,16 +185,12 @@ public class PlaylistsController : BaseJellyfinApiController /// The playlist id. /// The user id. /// User permission found. - /// No user permission found but open access. - /// Access forbidden. /// Playlist not found. /// /// . /// [HttpGet("{playlistId}/Users/{userId}")] [ProducesResponseType(StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status204NoContent)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] [ProducesResponseType(StatusCodes.Status404NotFound)] public ActionResult GetPlaylistUser( [FromRoute, Required] Guid playlistId, @@ -213,7 +209,12 @@ public class PlaylistsController : BaseJellyfinApiController || playlist.Shares.Any(s => s.CanEdit && s.UserId.Equals(callingUserId)) || userId.Equals(callingUserId); - return isPermitted ? userPermission is not null ? userPermission : NotFound("User permissions not found") : playlist.OpenAccess ? NoContent() : Forbid(); + if (isPermitted && userPermission is not null) + { + return userPermission; + } + + return NotFound("User permissions not found"); } ///