diff --git a/Jellyfin.Api/Controllers/PlaylistsController.cs b/Jellyfin.Api/Controllers/PlaylistsController.cs index ca90d2a6d8..69abe5f7eb 100644 --- a/Jellyfin.Api/Controllers/PlaylistsController.cs +++ b/Jellyfin.Api/Controllers/PlaylistsController.cs @@ -94,7 +94,7 @@ public class PlaylistsController : BaseJellyfinApiController UserId = userId.Value, MediaType = mediaType ?? createPlaylistRequest?.MediaType, Users = createPlaylistRequest?.Users.ToArray() ?? [], - Public = createPlaylistRequest?.Public + Public = createPlaylistRequest?.IsPublic }).ConfigureAwait(false); return result; @@ -143,7 +143,7 @@ public class PlaylistsController : BaseJellyfinApiController Name = updatePlaylistRequest.Name, Ids = updatePlaylistRequest.Ids, Users = updatePlaylistRequest.Users, - Public = updatePlaylistRequest.Public + Public = updatePlaylistRequest.IsPublic }).ConfigureAwait(false); return NoContent(); @@ -180,17 +180,19 @@ public class PlaylistsController : BaseJellyfinApiController } /// - /// Get a playlist users. + /// Get a playlist user. /// /// The playlist id. /// The user id. /// User permission found. + /// Access forbidden. /// Playlist not found. /// /// . /// [HttpGet("{playlistId}/Users/{userId}")] [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status403Forbidden)] [ProducesResponseType(StatusCodes.Status404NotFound)] public ActionResult GetPlaylistUser( [FromRoute, Required] Guid playlistId, @@ -209,7 +211,12 @@ public class PlaylistsController : BaseJellyfinApiController || playlist.Shares.Any(s => s.CanEdit && s.UserId.Equals(callingUserId)) || userId.Equals(callingUserId); - if (isPermitted && userPermission is not null) + if (!isPermitted) + { + return Forbid(); + } + + if (userPermission is not null) { return userPermission; } @@ -218,7 +225,7 @@ public class PlaylistsController : BaseJellyfinApiController } /// - /// Modify a user to a playlist's users. + /// Modify a user of a playlist's users. /// /// The playlist id. /// The user id. @@ -237,7 +244,7 @@ public class PlaylistsController : BaseJellyfinApiController public async Task UpdatePlaylistUser( [FromRoute, Required] Guid playlistId, [FromRoute, Required] Guid userId, - [FromBody(EmptyBodyBehavior = EmptyBodyBehavior.Allow)] UpdatePlaylistUserDto updatePlaylistUserRequest) + [FromBody(EmptyBodyBehavior = EmptyBodyBehavior.Allow), Required] UpdatePlaylistUserDto updatePlaylistUserRequest) { var callingUserId = User.GetUserId(); @@ -265,7 +272,7 @@ public class PlaylistsController : BaseJellyfinApiController } /// - /// Remove a user from a playlist's shares. + /// Remove a user from a playlist's users. /// /// The playlist id. /// The user id. diff --git a/Jellyfin.Api/Models/PlaylistDtos/CreatePlaylistDto.cs b/Jellyfin.Api/Models/PlaylistDtos/CreatePlaylistDto.cs index 69694a7699..3cbdd031a1 100644 --- a/Jellyfin.Api/Models/PlaylistDtos/CreatePlaylistDto.cs +++ b/Jellyfin.Api/Models/PlaylistDtos/CreatePlaylistDto.cs @@ -41,5 +41,5 @@ public class CreatePlaylistDto /// /// Gets or sets a value indicating whether the playlist is public. /// - public bool Public { get; set; } = true; + public bool IsPublic { get; set; } = true; } diff --git a/Jellyfin.Api/Models/PlaylistDtos/UpdatePlaylistDto.cs b/Jellyfin.Api/Models/PlaylistDtos/UpdatePlaylistDto.cs index 0e109db3ee..80e20995c6 100644 --- a/Jellyfin.Api/Models/PlaylistDtos/UpdatePlaylistDto.cs +++ b/Jellyfin.Api/Models/PlaylistDtos/UpdatePlaylistDto.cs @@ -30,5 +30,5 @@ public class UpdatePlaylistDto /// /// Gets or sets a value indicating whether the playlist is public. /// - public bool? Public { get; set; } + public bool? IsPublic { get; set; } }