navidrome/ui/src/common/playlistUtils.js
Deluan c7b93805ce feat: implement global playlist functionality with UI updates
Signed-off-by: Deluan <deluan@navidrome.org>
2026-01-16 11:24:58 -05:00

17 lines
449 B
JavaScript

export const isWritable = (ownerId) => {
return (
localStorage.getItem('userId') === ownerId ||
localStorage.getItem('role') === 'admin'
)
}
export const isReadOnly = (ownerId) => {
return !isWritable(ownerId)
}
export const isSmartPlaylist = (pls) => !!pls.rules
export const isGlobalPlaylist = (pls) => isSmartPlaylist(pls) && pls.global
export const canChangeTracks = (pls) =>
isWritable(pls.ownerId) && !isSmartPlaylist(pls)