Apply review suggestion

pull/11487/head
Shadowghost 4 weeks ago
parent f4acabc1e5
commit 7e01e192d8

@ -206,6 +206,11 @@ public class PlaylistsController : BaseJellyfinApiController
return NotFound("Playlist not found");
}
if (playlist.OwnerUserId.Equals(callingUserId))
{
return new PlaylistUserPermissions(callingUserId, true);
}
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))
@ -221,11 +226,6 @@ public class PlaylistsController : BaseJellyfinApiController
return userPermission;
}
if (playlist.OwnerUserId.Equals(callingUserId))
{
return new PlaylistUserPermissions(callingUserId, true);
}
return NotFound("User permissions not found");
}

Loading…
Cancel
Save