aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/PlaylistsController.cs
diff options
context:
space:
mode:
authorShadowghost <Ghost_of_Stone@web.de>2024-04-03 16:19:13 +0200
committerShadowghost <Ghost_of_Stone@web.de>2024-04-03 16:19:13 +0200
commitd72f40fe4159d83440c3362d137901e4c418c4b9 (patch)
tree215e5613f37d1735817a93ea1b03e8687ad65e4a /Jellyfin.Api/Controllers/PlaylistsController.cs
parent04c5b9d6800d7790d08958b9d6700299ba0c8e74 (diff)
Return 204 on OpenAccess
Diffstat (limited to 'Jellyfin.Api/Controllers/PlaylistsController.cs')
-rw-r--r--Jellyfin.Api/Controllers/PlaylistsController.cs6
1 files 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
/// </summary>
/// <param name="playlistId">The playlist id.</param>
/// <param name="userId">The user id.</param>
- /// <response code="200">Found shares.</response>
+ /// <response code="200">User permission found.</response>
+ /// <response code="200">No user permission found but open access.</response>
/// <response code="403">Access forbidden.</response>
/// <response code="404">Playlist not found.</response>
/// <returns>
@@ -192,6 +193,7 @@ public class PlaylistsController : BaseJellyfinApiController
/// </returns>
[HttpGet("{playlistId}/User/{userId}")]
[ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status204NoContent)]
[ProducesResponseType(StatusCodes.Status403Forbidden)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public ActionResult<PlaylistUserPermissions?> 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();
}
/// <summary>