{ e.preventDefault(); menu = { x: e.clientX, y: e.clientY }; }} use:keyboardActions > {#if artSize > 0} {@const artId = track?.albumId || track?.coverArt || id}
{#if type === "playlist" && isPublicState}
{/if} {#if (type === "album" || type === "artist") && isStarred}
{/if}
{/if}
{label}
{#if owner && type === "playlist" && owner.toLowerCase() !== auth.user?.toLowerCase()}
owner: {owner}
{/if}
{#if canUpdate}
{ e.stopPropagation(); doUpdate(); }} title={t("update_playlist")} >
{/if} {#if canDelete || type === "share"}
{ e.stopPropagation(); doDelete(); }} title={type === "share" ? t("delete_share") : t("delete_playlist")} >
{/if} {#if type === "share"}
{ e.stopPropagation(); if (item?.url) navigator.clipboard.writeText(item.url); }} title={t("copy_link")} >
{/if} {#if type !== "share"}
{ e.stopPropagation(); doAdd(false); }} title={t("add_to_queue")} >
{/if}
{ e.stopPropagation(); menu = { x: window.innerWidth, y: e.clientY }; }} title={t("context_menu")} > ⋮
{#if open}
{#if busy}
{t("busy")}
{:else if items} {#each items as item, i (item.id + i)}
{/each} {/if}
{/if}
{#if menu}
(menu = null)} x={menu.x} y={menu.y} items={[ type !== "share" && { label: t("add"), action: () => doAdd(false) }, type !== "share" && { label: t("add_next"), action: () => doAdd(true) }, type !== "share" && { type: "separator" }, lib.isSharingSupported && type !== "share" && { label: t("share"), action: () => { ui.shareItemId = id; ui.shareItemLabel = label; ui.shareItemType = type; }, }, type === "share" && { label: t("copy_link"), action: () => { if (item?.url) navigator.clipboard.writeText(item.url); }, }, ...(type === "album" || type === "artist" ? [ { label: isStarred ? t("unfavorite") : t("favorite"), action: doToggleStar, }, ] : []), ...(type === "playlist" ? [ ...(canUpdate ? [{ label: t("update"), action: doUpdate }] : []), ...(canDelete ? [ { label: t("rename"), action: doRename }, ...(isOwner || auth.admin ? [ { label: isPublicState ? t("make_private") : t("make_public"), action: doTogglePublic, }, ] : []), { label: t("delete"), action: doDelete }, ] : []), ] : []), type === "share" && { label: t("delete"), action: doDelete }, ].filter(Boolean) as any} /> {/if}