forked from Furumi/furumi-web
Import library sits between Followed and Settings in the account menu and opens #imports: the sources, the history with statistics and links to the created playlists, and #imports/N with progress, per-playlist results, a deleted-playlist notice with Create again, and the entries with status and playlist filters, search, paging and the candidates of doubtful entries to choose from. Retry unmatched (with the federated search consent), Cancel, Delete history and a new Spotify sign-in for waiting imports call the existing /api/imports endpoints. The page polls every 3 s while an import runs. It follows the player's views, skeletons, dialogs, switches and phrase table in English and Russian. The New import wizard picks a source, then the data export or the Spotify sign-in, then the playlists: imported ones cannot be selected, similar ones need an explicit confirmation, and federated search is off until the user turns it on. A ZIP export is opened in the browser with fflate 0.8.2, vendored with its MIT licence and served at /vendor/fflate-0.8.2.js only when an archive is picked. Only Playlist*.json and YourLibrary.json are extracted; archives over 256 MiB, with more than 2,000 entries, more than 256 playlist files or more than 32 MiB declared for them are refused before anything is decompressed, and a request over 32 MiB is not sent. Federated tracks can now be removed from a playlist in edit mode: DELETE /api/player/tracks/content/playlist checks the owner and records the existing PlaylistTrackRemoved operation. The body-level dialogs get an Alpine root, which also makes Get app open again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1380 lines
112 KiB
HTML
1380 lines
112 KiB
HTML
<div class="app-layout{% if guest %} guest-player{% endif %}"
|
||
x-data
|
||
@keydown.window.space="if (!['INPUT','TEXTAREA','SELECT'].includes(document.activeElement?.tagName)) { $event.preventDefault(); $store.player.toggle(); }"
|
||
@keydown.window.arrow-left="if (!['INPUT','TEXTAREA','SELECT'].includes(document.activeElement?.tagName)) { $event.preventDefault(); $store.player.seekRelative(-5); }"
|
||
@keydown.window.arrow-right="if (!['INPUT','TEXTAREA','SELECT'].includes(document.activeElement?.tagName)) { $event.preventDefault(); $store.player.seekRelative(5); }"
|
||
@keydown.window="if ((e=$event).ctrlKey && e.key==='k') { e.preventDefault(); document.getElementById('search-input')?.focus(); } else if (e.key==='/' && !['INPUT','TEXTAREA','SELECT'].includes(document.activeElement?.tagName)) { e.preventDefault(); document.getElementById('search-input')?.focus(); }"
|
||
>
|
||
|
||
{% if !guest && share_token.is_empty() %}
|
||
<div class="offline-status-banner" role="status" aria-atomic="true"
|
||
title="{{ t.player_offline_saved_only }}">
|
||
<div class="offline-status-clip">
|
||
<div class="offline-status-content">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
||
<g x-show="$store.offline.manual">
|
||
<rect x="2" y="6" width="20" height="12" rx="6"/><circle cx="15.5" cy="12" r="3" fill="currentColor" stroke="none"/>
|
||
</g>
|
||
<g x-show="!$store.offline.manual" transform="rotate(-35 12 12)">
|
||
<path d="M1 12h2m3-3h2v6H6a3 3 0 0 1 0-6ZM8 10.5h3m-3 3h3M15 9h3a3 3 0 0 1 0 6h-3ZM21 12h2"/>
|
||
</g>
|
||
</svg>
|
||
<strong>{{ t.player_offline_manual }}</strong>
|
||
<span class="offline-status-reason" x-text="$store.offline.manual ? '{{ t.player_offline_manual_reason }}' : '{{ t.player_offline_auto_reason }}'"></span>
|
||
<span class="offline-status-note">{{ t.player_offline_saved_only }}</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
<div class="main-content">
|
||
{% if !guest %}
|
||
<aside class="sidebar-left">
|
||
<header class="sidebar-brand">
|
||
<h2><button class="sidebar-wordmark" type="button" @click="nudgeWordmark($el)" @keydown.space.stop><span>#</span>furumi</button></h2>
|
||
<a class="sidebar-build-version" href="https://gt.hexor.cy/Furumi/furumi-web"
|
||
target="_blank" rel="noopener noreferrer">v{{ t.app_version() }}</a>
|
||
</header>
|
||
{% include "player/sidebar_nav.html" %}
|
||
<div class="sidebar-account" data-account-menu x-show="$store.user.profile" x-cloak
|
||
@keydown.escape="if ($store.user.menuOpen) { $store.user.menuOpen = false; $refs.accountTrigger.focus() }">
|
||
<button class="sidebar-account-trigger" type="button" x-ref="accountTrigger"
|
||
aria-controls="sidebar-account-actions" :aria-expanded="$store.user.menuOpen"
|
||
@click="$store.user.menuOpen = !$store.user.menuOpen">
|
||
<span class="user-avatar" x-text="$store.user.initials()"></span>
|
||
<span class="user-name" x-text="$store.user.profile?.name"></span>
|
||
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="m6 14 6-6 6 6"/></svg>
|
||
</button>
|
||
<div class="sidebar-account-popover account-popover" id="sidebar-account-actions" inert :inert="$store.user.menuOpen ? null : true" x-cloak>
|
||
{% include "player/account_actions.html" %}
|
||
</div>
|
||
</div>
|
||
</aside>
|
||
<template x-if="!$store.mobile.libraryOpen">
|
||
{% include "player/pin_undo.html" %}
|
||
</template>
|
||
<template x-if="$store.mobile.libraryOpen">
|
||
<dialog class="mobile-library-backdrop" aria-label="{{ t.player_library }}"
|
||
x-init="$nextTick(() => $el.isConnected && $el.showModal())"
|
||
@resize.window="if (!$store.mobile.isMobilePlayer()) $store.mobile.closeLibrary()"
|
||
@cancel.prevent="$store.mobile.closeLibrary()" @click.self="$store.mobile.closeLibrary()">
|
||
<div class="mobile-library-drawer">
|
||
<div class="mobile-drawer-head">
|
||
<span class="mobile-drawer-title">{{ t.player_library }}</span>
|
||
<button class="mobile-list-action" type="button" autofocus
|
||
@click="$store.mobile.closeLibrary()" aria-label="{{ t.player_close }}">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="m6 6 12 12M18 6 6 18"/></svg>
|
||
</button>
|
||
</div>
|
||
<div class="mobile-drawer-body"
|
||
@click="if ($event.target.closest('a[href]') && !($event.ctrlKey || $event.metaKey || $event.shiftKey || $event.altKey)) $store.mobile.closeLibrary()">
|
||
{% include "player/sidebar_nav.html" %}
|
||
</div>
|
||
{% include "player/pin_undo.html" %}
|
||
</div>
|
||
</dialog>
|
||
</template>
|
||
{% endif %}
|
||
|
||
<!-- Center Content -->
|
||
<div class="center-content" id="center-scroll">
|
||
<!-- Search / account bar -->
|
||
<div class="content-topbar">
|
||
<button data-member-only type="button" class="mobile-library-btn" aria-haspopup="dialog" :aria-expanded="$store.mobile.libraryOpen"
|
||
@click="$store.user.menuOpen = false; $store.mobile.toggleLibrary()"
|
||
title="{{ t.player_library }}">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||
<path d="M4 19.5A2.5 2.5 0 016.5 17H20"/>
|
||
<path d="M4 4.5A2.5 2.5 0 016.5 2H20v20H6.5A2.5 2.5 0 014 19.5z"/>
|
||
</svg>
|
||
</button>
|
||
<div class="connection-alert" data-online-only
|
||
x-show="$store.connection.disconnected"
|
||
x-cloak
|
||
:title="$store.connection.message()"
|
||
role="status"
|
||
aria-live="polite">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||
<path d="M2 8.82a15 15 0 0120 0"/>
|
||
<path d="M5 12.86a10 10 0 0114 0"/>
|
||
<path d="M8.5 16.43a5 5 0 017 0"/>
|
||
<line x1="2" y1="2" x2="22" y2="22"/>
|
||
</svg>
|
||
<span class="connection-alert-text">{{ t.player_connection_lost }}</span>
|
||
</div>
|
||
{% if guest %}
|
||
<div class="guest-account">
|
||
<strong>{{ t.guest_label }}</strong>
|
||
<div x-show="$store.user.accessStatus === 'pending'" x-cloak><span>{{ t.approval_heading }}</span> · <a href="/logout">{{ t.player_log_out }}</a></div>
|
||
<a x-show="$store.user.accessStatus === 'anonymous'" href="/login?next=/share/{{ share_token }}">{{ t.guest_login }}</a>
|
||
</div>
|
||
{% endif %}
|
||
<div class="search-bar"
|
||
x-data="{ expanded:false, left:0, right:0, observer:null, init() { this.observer=new ResizeObserver(()=>this.measure()); this.observer.observe($el); }, destroy() { this.observer?.disconnect(); }, measure() { const bar=$el.getBoundingClientRect(); const panel=$el.closest('.content-topbar').getBoundingClientRect(); this.left=Math.max(0,bar.left-panel.left); this.right=Math.max(0,panel.right-bar.right); } }"
|
||
:class="{ 'search-expanded':expanded, 'lyrics-search-mode':$store.library.searchMode==='lyrics' }"
|
||
:style="{ '--search-expand-left':left+'px', '--search-expand-right':right+'px' }"
|
||
@focusin="measure(); expanded=true"
|
||
@focusout="if (!$el.contains($event.relatedTarget)) expanded=false"
|
||
@resize.window="measure()">
|
||
<div class="search-field">
|
||
<button :disabled="$store.offline?.active" class="search-icon search-mode-toggle" type="button" @pointerdown.prevent @click="$store.library.toggleSearchMode(); $refs.searchInput.focus()" :aria-pressed="$store.library.searchMode==='lyrics'" :aria-label="$store.lyricsSearch.text($store.library.searchMode==='lyrics'?'normal':'lyrics')" :title="$store.lyricsSearch.text($store.library.searchMode==='lyrics'?'normal':'lyrics')">
|
||
<svg x-show="$store.library.searchMode!=='lyrics'" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/></svg>
|
||
<svg x-show="$store.library.searchMode==='lyrics'" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="M5 5h11M5 10h8M5 15h5M18 13v7M18 13l3-1"/><circle cx="15.5" cy="20" r="2.5"/></svg>
|
||
</button>
|
||
<input id="search-input" x-ref="searchInput" type="text" :placeholder="$store.library.searchMode==='lyrics'?$store.lyricsSearch.text('placeholder'):'{{ t.player_search_placeholder }}'"
|
||
:maxlength="$store.library.searchMode==='lyrics'?500:null"
|
||
x-model="$store.library.searchQuery"
|
||
@input="$store.library.queueSearch()"
|
||
@keydown.enter.prevent="$store.library.search($store.library.searchQuery)"
|
||
@keydown.escape="$store.library.clearSearch(); $el.blur()">
|
||
<template x-if="$store.library.searchQuery">
|
||
<button class="search-clear" @pointerdown.prevent @click="$store.library.clearSearch(); $refs.searchInput.focus()">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
|
||
</button>
|
||
</template>
|
||
<template x-if="!$store.library.searchQuery">
|
||
<span class="search-shortcut">Ctrl+K</span>
|
||
</template>
|
||
</div>
|
||
</div>
|
||
{% if downloads_enabled %}
|
||
<button class="torrent-import-btn" data-online-only
|
||
@click="$store.torrents.open()"
|
||
title="{{ t.player_import_torrent }}">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||
<path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"/>
|
||
<polyline points="7 10 12 15 17 10"/>
|
||
<line x1="12" y1="15" x2="12" y2="3"/>
|
||
</svg>
|
||
</button>
|
||
{% endif %}
|
||
{% if !guest %}
|
||
<div class="mobile-account-control" data-account-menu x-show="$store.user.profile" x-cloak
|
||
@keydown.escape="if ($store.user.menuOpen) { $store.user.menuOpen = false; $refs.mobileAccountTrigger.focus() }">
|
||
<button class="mobile-account-chip" type="button" x-ref="mobileAccountTrigger"
|
||
aria-label="{{ t.player_account_menu }}" aria-controls="mobile-account-actions"
|
||
:aria-expanded="$store.user.menuOpen"
|
||
@click="$store.mobile.closeLibrary(); $store.user.menuOpen = !$store.user.menuOpen">
|
||
<span class="user-avatar" x-text="$store.user.initials()"></span>
|
||
</button>
|
||
<div class="mobile-account-popover account-popover" id="mobile-account-actions" inert :inert="$store.user.menuOpen ? null : true" x-cloak>
|
||
<div class="account-menu-name" x-text="$store.user.profile?.name"></div>
|
||
{% include "player/account_actions.html" %}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
|
||
<!-- Search Results -->
|
||
{% include "player/podcasts.html" %}
|
||
{% if !guest %}
|
||
{% include "player/collection.html" %}
|
||
{% include "player/imports.html" %}
|
||
{% endif %}
|
||
{% include "player/listening.html" %}
|
||
<template x-if="$store.library.pendingDetail">
|
||
<div class="page-skeleton" :data-skeleton="$store.library.pendingDetail" role="status">
|
||
<span class="loading-label">{{ t.player_loading_content }}</span>
|
||
<div aria-hidden="true">
|
||
<div class="breadcrumb"><i class="skeleton-bar skeleton-crumb"></i></div>
|
||
<div :class="{ 'artist-header': $store.library.pendingDetail === 'artist', 'release-header': $store.library.pendingDetail === 'release', 'playlist-detail-heading': $store.library.pendingDetail === 'playlist' }">
|
||
<div class="skeleton-art" :class="{ 'artist-img': $store.library.pendingDetail === 'artist', 'release-cover': $store.library.pendingDetail === 'release', 'playlist-heading-cover': $store.library.pendingDetail === 'playlist' }"></div>
|
||
<div class="skeleton-caption">
|
||
<i class="skeleton-bar skeleton-title"></i>
|
||
<i class="skeleton-bar skeleton-byline"></i>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
{% include "player/skeleton_tracks.html" %}
|
||
</div>
|
||
</template>
|
||
<template x-if="$store.library.view === 'offline_unavailable'">
|
||
<div class="empty-state" role="status">
|
||
<p>{{ t.player_offline_page_missing }}</p>
|
||
<a class="artist-link" href="#artists">{{ t.player_offline_open_catalog }}</a>
|
||
</div>
|
||
</template>
|
||
<template x-if="$store.library.view === 'search'">
|
||
<div>
|
||
<div class="search-similarity-heading"
|
||
x-show="$store.library.similaritySearchLabel"
|
||
x-cloak>
|
||
<h2 class="search-similarity-title">
|
||
<span>{{ t.player_search_similar_to }}</span>
|
||
<strong x-text="$store.library.similaritySearchLabel"></strong>
|
||
</h2>
|
||
<div class="search-similarity-progress"
|
||
:class="{ loading: $store.library.similaritySearchStats.loading }">
|
||
<template x-if="$store.library.similaritySearchStats.loading">
|
||
<span class="search-progress-live"><i></i> Searching peers…</span>
|
||
</template>
|
||
<span x-text="`${$store.library.similaritySearchStats.tracks} tracks · ${$store.library.similaritySearchStats.artists} artists`"></span>
|
||
<template x-if="!$store.library.similaritySearchStats.loading">
|
||
<span x-text="`${$store.library.similaritySearchStats.peers} peers · ${$store.library.formatSearchDuration($store.library.similaritySearchStats.elapsed_ms)}`"></span>
|
||
</template>
|
||
</div>
|
||
</div>
|
||
<p class="lyrics-search-note" x-show="$store.library.searchMode==='lyrics'" x-text="$store.lyricsSearch.text('local')"></p>
|
||
<p class="lyrics-search-note" role="status" x-show="$store.library.searchMode==='lyrics' && ($store.library.searchResults?.semantic_error || ($store.library.searchResults?.lyrics_status?.ready_chunks ?? 1)===0)" x-text="$store.lyricsSearch.text('lexical')"></p>
|
||
<template x-if="!$store.library.hasDisplaySearchResults && ($store.library.searchLoading || ($store.library.ordinarySearch && $store.library.federationSearch.loading))">
|
||
<div class="page-skeleton" role="status">
|
||
<span class="loading-label">{{ t.player_loading_content }}</span>
|
||
{% include "player/skeleton_tracks.html" %}
|
||
</div>
|
||
</template>
|
||
<template x-if="!$store.library.searchLoading && $store.library.similaritySearchError">
|
||
<div class="empty-state">
|
||
<p x-text="$store.library.similaritySearchError"></p>
|
||
</div>
|
||
</template>
|
||
<template x-if="$store.library.displaySearchResults">
|
||
<div>
|
||
<template x-if="!$store.library.hasDisplaySearchResults && !$store.library.searchLoading && !$store.library.federationSearch.loading && !$store.library.similaritySearchStats.loading && !$store.library.similaritySearchError && !$store.library.federationSearch.error">
|
||
<div class="empty-state">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
|
||
<p>{{ t.player_no_results }}</p>
|
||
</div>
|
||
</template>
|
||
<!-- Artists section -->
|
||
<template x-if="$store.library.displaySearchResults.artists.length">
|
||
<div class="search-section">
|
||
<h2 class="search-section-title">{{ t.player_artists }}</h2>
|
||
<div class="search-artists-row">
|
||
<template x-for="artist in $store.library.displaySearchResults.artists" :key="artist.searchKey ?? artist.id">
|
||
<div class="search-artist-card"
|
||
:class="{ 'search-result-enter': $store.library.ordinarySearch, 'search-federation-only': artist.federation_only }"
|
||
:data-search-key="artist.searchKey"
|
||
@click="artist.federation_only ? $store.library.openFederatedArtist(artist._federationArtist) : $store.library.openArtist(artist.id)">
|
||
<div class="search-artist-img">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="12" cy="8" r="4"/><path d="M20 21a8 8 0 10-16 0"/></svg>
|
||
<template x-if="$store.library.localSearchArtwork('artists', artist)">
|
||
<img class="artwork-image" x-artwork="$store.library.localSearchArtwork('artists', artist) || null" alt="" aria-hidden="true" loading="lazy" @error="$store.library.federationArtworkFailed($event.currentTarget)">
|
||
</template>
|
||
</div>
|
||
<div class="search-artist-name"><a class="artist-link"
|
||
:href="$store.library.artistHref(artist.federation_only ? artist._federationArtist : artist)"
|
||
:aria-label="artist.federation_only ? artist.name + ' · {{ t.player_federated_result }}' : null"
|
||
@click.stop x-text="artist.name"></a></div>
|
||
</div>
|
||
</template>
|
||
</div>
|
||
</div>
|
||
</template>
|
||
<!-- Releases section -->
|
||
<template x-if="$store.library.displaySearchResults.releases.length">
|
||
<div class="search-section">
|
||
<h2 class="search-section-title">{{ t.player_releases }}</h2>
|
||
<div class="search-releases-row">
|
||
<template x-for="release in $store.library.displaySearchResults.releases" :key="release.searchKey ?? release.id">
|
||
<div class="search-release-card"
|
||
:class="{ 'search-result-enter': $store.library.ordinarySearch, 'search-federation-only': release.federation_only }"
|
||
:data-search-key="release.searchKey"
|
||
@click="$store.library.openSearchRelease(release)">
|
||
<div class="search-release-cover" style="position:relative">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="12" cy="12" r="4"/></svg>
|
||
<template x-if="$store.library.localSearchArtwork('releases', release)">
|
||
<img class="artwork-image" x-artwork="$store.library.localSearchArtwork('releases', release) || null" alt="" aria-hidden="true" loading="lazy" @error="$store.library.federationArtworkFailed($event.currentTarget)">
|
||
</template>
|
||
<button class="card-info-btn" @click.stop="$store.library.openReleaseInfo(release)" :title="$store.library.releaseInfo(release)" aria-label="{{ t.player_release_info }}">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="16" x2="12" y2="12"/><line x1="12" y1="8" x2="12.01" y2="8"/></svg>
|
||
</button>
|
||
</div>
|
||
<div class="card-title"><a class="artist-link"
|
||
:href="$store.library.releaseHref(release.federation_only ? release._federationRelease : release)"
|
||
:aria-label="release.federation_only ? release.title + ' · {{ t.player_federated_result }}' : null"
|
||
@click.stop="if (release.federation_only && $store.library.followsHere($event)) { $event.preventDefault(); $store.library.openSearchRelease(release) }"
|
||
x-text="release.title"></a></div>
|
||
<div class="card-subtitle">
|
||
<span x-text="release.year || ''"></span>
|
||
<span x-text="release.release_type || ''"></span>
|
||
<template x-for="(artist, idx) in release.artists || release._federationRelease?.artists || []" :key="idx">
|
||
<span><span x-show="release.year || release.release_type || idx"> · </span><a class="artist-link" :href="$store.library.artistHref(artist)" @click.stop x-text="artist.name || artist"></a></span>
|
||
</template>
|
||
</div>
|
||
</div>
|
||
</template>
|
||
</div>
|
||
</div>
|
||
</template>
|
||
<!-- Tracks section -->
|
||
<template x-if="$store.library.displaySearchResults.tracks.length">
|
||
<div class="search-section" x-data="{ versionGroups: $store.searchGroups }">
|
||
<h2 class="search-section-title">{{ t.player_tracks }}</h2>
|
||
<div class="track-list-header">
|
||
<span>#</span>
|
||
<span>{{ t.player_title }}</span>
|
||
<span></span>
|
||
<span></span>
|
||
<span style="text-align:right">{{ t.player_duration }}</span>
|
||
</div>
|
||
<template x-for="track in $store.searchGroups.rows($store.library.displaySearchResults.tracks, 'search', !$store.library.similaritySearchLabel)" :key="track.searchKey || track.id">
|
||
<div class="search-result-entry search-standard-entry" :data-search-source="track.federation_only ? 'federation' : 'local'" :id="track._searchRowId" :class="{ 'search-result-variant':track._searchGroupChild, 'search-result-hidden':track._searchGroupHidden }" :aria-hidden="track._searchGroupHidden" :inert="track._searchGroupHidden ? true : null"><div class="search-result-clip">
|
||
<div class="track-row"
|
||
:class="{ 'search-track-variant':track._searchGroupChild, 'search-result-enter':$store.library.searchMode === 'normal', 'search-federation-only':track.federation_only, playing: $store.player.currentTrack && $store.player.currentTrack.id === track.id }"
|
||
:aria-description="track.federation_only ? '{{ t.player_federated_result }}' : null"
|
||
tabindex="0" @click="if ($event.detail < 2) { $store.library.similaritySearchLabel ? $store.library.playSimilarityResult(track) : $store.library.playSearchTrack(track._searchSourceIndex) }" @dblclick.stop @keydown.enter.self.prevent="$store.library.similaritySearchLabel ? $store.library.playSimilarityResult(track) : $store.library.playSearchTrack(track._searchSourceIndex)">
|
||
<span class="track-num" x-text="$store.library.searchTrackNumber(track)"
|
||
:title="track.federation_only ? $store.library.federationDownloadTooltip(track.content_id) || $store.library.federationFailure(track.content_id)?.message : null"></span>
|
||
<div class="track-info">
|
||
<div class="track-title search-track-title">
|
||
{% include "player/track_version_toggle.html" %}
|
||
<span class="search-track-name" x-text="track.title"></span>
|
||
</div>
|
||
<div class="track-artists-inline">
|
||
{% include "player/track_artist_links.html" %}
|
||
</div>
|
||
<div class="search-variant-detail">{% include "player/search_track_release.html" %}</div>
|
||
|
||
</div>
|
||
<span class="track-album">{% include "player/search_track_release.html" %}</span>
|
||
<div class="track-actions">
|
||
{% include "player/track_row_badges.html" %}
|
||
<button data-online-only data-member-only class="like-btn" :class="{ liked: $store.library.searchTrackLiked(track) }" @click.stop="track.federation_only ? $store.library.toggleFederationLike(track._federationTrack) : $store.likes.toggle(track.id)" title="{{ t.player_like }}">
|
||
<svg viewBox="0 0 24 24" :fill="$store.library.searchTrackLiked(track) ? 'currentColor' : 'none'" stroke="currentColor" stroke-width="2"><path d="M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78L12 21.23l8.84-8.84a5.5 5.5 0 000-7.78z"/></svg>
|
||
</button>
|
||
<button class="track-action-btn queue-insert-btn queue-next-btn" @click.stop="$store.queue.addNextInQueue([track])" title="{{ t.player_play_next }}">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M5 6h10M5 12h7M5 18h10"/><path d="M17 9l4 3-4 3" fill="currentColor" stroke="none"/></svg>
|
||
</button>
|
||
{% include "player/track_actions_button.html" %}
|
||
</div>
|
||
<span class="track-duration" x-text="formatTime(track.duration_seconds)"></span>
|
||
</div>
|
||
</div></div>
|
||
</template>
|
||
</div>
|
||
</template>
|
||
<template x-if="$store.library.displaySearchResults.podcasts?.length">
|
||
<section class="search-section">
|
||
<h2 class="search-section-title" x-text="$store.podcasts.text('podcasts')"></h2>
|
||
<div class="search-releases-row">
|
||
<template x-for="pod in $store.library.displaySearchResults.podcasts" :key="pod.id">
|
||
{% include "player/podcast_search_card.html" %}
|
||
</template>
|
||
</div>
|
||
</section>
|
||
</template>
|
||
<template x-if="$store.library.federationSearch.error">
|
||
<p class="federation-search-status error" role="status" x-text="$store.library.federationSearch.error"></p>
|
||
</template>
|
||
<div class="similarity-search-inline-progress"
|
||
x-show="$store.library.similaritySearchLabel && $store.library.similaritySearchStats.loading" x-cloak>
|
||
<span class="similarity-search-inline-spinner" aria-hidden="true"></span>
|
||
<span>Searching federation for more similar tracks…</span>
|
||
</div>
|
||
</div>
|
||
</template>
|
||
</div>
|
||
</template>
|
||
|
||
{% if !guest %}
|
||
<!-- Artists Grid -->
|
||
<template x-if="$store.library.view === 'artists' || $store.library.view === 'my_uploads'">
|
||
<div>
|
||
{% include "player/collection_header.html" %}
|
||
<div class="card-grid">
|
||
<template x-for="(artist, idx) in $store.library.artists" :key="artist.id">
|
||
<div class="artist-grid-entry">
|
||
<div class="artist-section-divider"
|
||
x-show="$store.library.shouldShowFeaturedSeparator(idx)"
|
||
x-cloak>
|
||
<span>{{ t.player_featured_only_artists }}</span>
|
||
</div>
|
||
<div class="card" @click="$store.library.openArtist(artist.id)">
|
||
<div class="card-img">
|
||
<template x-if="artist.image_url">
|
||
<img x-artwork="artist.image_url" alt="" aria-hidden="true" loading="lazy">
|
||
</template>
|
||
<template x-if="!artist.image_url">
|
||
<span class="placeholder-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="12" cy="8" r="4"/><path d="M20 21a8 8 0 10-16 0"/></svg></span>
|
||
</template>
|
||
<button data-online-only data-member-only class="artist-follow-card-btn"
|
||
:class="{ followed: $store.follows.has(artist.id) }"
|
||
@click.stop="$store.follows.toggle(artist.id)"
|
||
:title="$store.follows.has(artist.id) ? '{{ t.player_unfollow_artist }}' : '{{ t.player_follow_artist }}'">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||
<path d="M16 21v-2a4 4 0 00-4-4H6a4 4 0 00-4 4v2"/>
|
||
<circle cx="9" cy="7" r="4"/>
|
||
<path x-show="!$store.follows.has(artist.id)" d="M19 8v6M16 11h6"/>
|
||
<path x-show="$store.follows.has(artist.id)" d="M16 11l2 2 4-5"/>
|
||
</svg>
|
||
</button>
|
||
</div>
|
||
<div class="card-title" x-text="artist.name"></div>
|
||
<div class="card-subtitle" x-text="formatArtistCount(artist.release_count, 'releases') + ' · ' + formatArtistCount(artist.track_count, 'tracks')"></div>
|
||
</div>
|
||
</div>
|
||
</template>
|
||
</div>
|
||
<template x-if="!$store.library.loading && $store.library.artists.length === 0">
|
||
<div class="empty-state">
|
||
<p x-show="$store.library.view === 'my_uploads'" x-text="$store.offline.active ? '{{ t.player_offline_empty_uploads }}' : '{{ t.player_no_uploaded_tracks }}'"></p>
|
||
<p x-show="$store.library.view === 'artists'" x-text="$store.offline.active ? '{{ t.player_offline_empty }}' : '{{ t.artists_empty }}'"></p>
|
||
<p data-offline-only>{{ t.player_offline_start }}</p>
|
||
</div>
|
||
</template>
|
||
<template x-if="$store.library.loading && $store.library.artists.length === 0">
|
||
{% include "player/skeleton_cards.html" %}
|
||
</template>
|
||
<div class="scroll-load-indicator"
|
||
x-show="$store.library.loading && $store.library.artists.length > 0"
|
||
x-cloak
|
||
role="status"
|
||
aria-live="polite">
|
||
<div class="scroll-load-spinner"></div>
|
||
<span>{{ t.player_loading_more }}</span>
|
||
</div>
|
||
<div id="artist-sentinel" style="height:1px"></div>
|
||
</div>
|
||
</template>
|
||
{% endif %}
|
||
|
||
<!-- Artist Detail -->
|
||
<template x-if="$store.library.view === 'artist_detail' && !$store.library.currentArtist && $store.library.artistUnavailable">
|
||
<div class="empty-state" role="status">{{ t.player_artist_unavailable }}</div>
|
||
</template>
|
||
<template x-if="$store.library.view === 'artist_detail' && $store.library.currentArtist">
|
||
<div>
|
||
<div class="breadcrumb">
|
||
<a @click="$store.library.artistFilter === 'uploads' ? $store.library.goMyUploads() : $store.library.goArtists()"
|
||
x-text="$store.library.artistFilter === 'uploads' ? '{{ t.player_my_uploads }}' : '{{ t.player_global_library }}'"></a>
|
||
<span>/</span>
|
||
<span x-text="$store.library.currentArtist.name"></span>
|
||
</div>
|
||
<div class="artist-header">
|
||
<div class="artist-img">
|
||
<template x-if="$store.library.currentArtist.image_url">
|
||
<img x-artwork="$store.library.currentArtist.image_url"
|
||
alt="" aria-hidden="true"
|
||
@error="$store.library.currentArtist.image_url = null">
|
||
</template>
|
||
<template x-if="!$store.library.currentArtist.image_url">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="12" cy="8" r="4"/><path d="M20 21a8 8 0 10-16 0"/></svg>
|
||
</template>
|
||
</div>
|
||
<div>
|
||
<div class="artist-name" x-text="$store.library.currentArtist.name"></div>
|
||
<div class="artist-stats">
|
||
<span x-text="formatArtistCount($store.library.currentArtist.releases.length + $store.library.artistFederation.releases.length, 'releases')"></span>
|
||
<span>•</span>
|
||
<span x-text="formatArtistCount($store.library.artistTrackCount(), 'tracks')"></span>
|
||
<span>•</span>
|
||
<span x-text="formatArtistCount($store.library.currentArtist.total_play_count, 'plays')"></span>
|
||
<span class="federation-live-badge"
|
||
x-show="$store.library.artistFederation.loading"
|
||
x-cloak>FEDERATION LIVE</span>
|
||
</div>
|
||
<div class="release-actions artist-actions">
|
||
<div x-data="{ get target() { return $store.pins.target('artist', $store.library.currentArtist) } }">{% include "player/pin_button.html" %}</div>
|
||
<button class="release-action-btn primary artist-listen-action"
|
||
:disabled="!($store.library.currentArtist.top_tracks?.length || $store.library.currentArtist.featured_tracks?.length || $store.library.artistFederation.tracks.length)"
|
||
@click="$store.library.listenToArtist()"
|
||
title="{{ t.player_listen_artist }}">
|
||
<svg viewBox="0 0 24 24" fill="currentColor" stroke="none">
|
||
<path d="M8 5v14l11-7z"/>
|
||
</svg>
|
||
<span>{{ t.player_listen }}</span>
|
||
</button>
|
||
<button data-online-only data-member-only class="release-action-btn secondary artist-follow-action"
|
||
x-show="$store.library.currentArtist.id"
|
||
:class="{ followed: $store.follows.has($store.library.currentArtist.id) }"
|
||
@click="$store.follows.toggle($store.library.currentArtist.id)"
|
||
:title="$store.follows.has($store.library.currentArtist.id) ? '{{ t.player_unfollow_artist }}' : '{{ t.player_follow_artist }}'">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||
<path d="M16 21v-2a4 4 0 00-4-4H6a4 4 0 00-4 4v2"/>
|
||
<circle cx="9" cy="7" r="4"/>
|
||
<path x-show="!$store.follows.has($store.library.currentArtist.id)" d="M19 8v6M16 11h6"/>
|
||
<path x-show="$store.follows.has($store.library.currentArtist.id)" d="M16 11l2 2 4-5"/>
|
||
</svg>
|
||
<span x-text="$store.follows.has($store.library.currentArtist.id) ? '{{ t.player_followed }}' : '{{ t.player_follow }}'"></span>
|
||
</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<template x-if="$store.library.currentArtist.federated && $store.library.artistFederation.loading && !$store.library.artistFederation.tracks.length && !$store.library.artistFederation.releases.length">
|
||
{% include "player/skeleton_tracks.html" %}
|
||
</template>
|
||
<template x-if="$store.library.currentArtist.top_tracks && $store.library.currentArtist.top_tracks.length > 0">
|
||
{% include "player/artist_popular_tracks.html" %}
|
||
</template>
|
||
|
||
<template x-for="group in $store.library.artistReleaseGroups()" :key="group.type">
|
||
<section class="artist-release-group">
|
||
<h2 class="artist-release-group-title" x-text="group.label"></h2>
|
||
<div class="card-grid">
|
||
<template x-for="release in group.releases" :key="release.id">
|
||
<div class="card" @click="$store.library.openRelease(release.id)">
|
||
<div class="card-img">
|
||
<template x-if="release.cover_url">
|
||
<img x-artwork="release.cover_url" alt="" aria-hidden="true"
|
||
loading="lazy" @error="release.cover_url = null">
|
||
</template>
|
||
<template x-if="!release.cover_url">
|
||
<span class="placeholder-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="12" cy="12" r="4"/></svg></span>
|
||
</template>
|
||
<button class="card-info-btn" @click.stop="$store.library.openReleaseInfo(release)" :title="$store.library.releaseInfo(release)" aria-label="{{ t.player_release_info }}">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="16" x2="12" y2="12"/><line x1="12" y1="8" x2="12.01" y2="8"/></svg>
|
||
</button>
|
||
<button class="card-enqueue-btn" @click.stop="$store.library.enqueueRelease(release.id)" title="{{ t.player_add_to_queue }}">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
|
||
</button>
|
||
<button class="card-play-btn" @click.stop="$store.library.playRelease(release.id)">
|
||
<svg viewBox="0 0 24 24"><path d="M8 5v14l11-7z"/></svg>
|
||
</button>
|
||
</div>
|
||
<div class="card-title" x-text="release.title"></div>
|
||
<div class="card-subtitle">
|
||
<span x-text="release.year || ''"></span>
|
||
<span x-text="release.track_count + ' {{ t.player_tracks_count }}'"></span>
|
||
</div>
|
||
</div>
|
||
</template>
|
||
</div>
|
||
</section>
|
||
</template>
|
||
<template x-if="$store.library.artistFederation.releases.length > 0">
|
||
<section class="artist-release-group federation-artist-section">
|
||
<h2 class="artist-release-group-title">Federation</h2>
|
||
<div class="card-grid">
|
||
<template x-for="release in $store.library.artistFederation.releases"
|
||
:key="release.identity">
|
||
<div class="card federation-release-card"
|
||
@click="$store.library.openFederatedRelease(release)">
|
||
<div class="card-img">
|
||
<template x-if="release.cover_url">
|
||
<img x-artwork="release.cover_url" alt="" aria-hidden="true"
|
||
loading="lazy" @error="release.cover_url = null">
|
||
</template>
|
||
<template x-if="!release.cover_url">
|
||
<span class="placeholder-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="12" cy="12" r="4"/></svg></span>
|
||
</template>
|
||
<button class="card-play-btn"
|
||
:disabled="!release.tracks.length"
|
||
@click.stop="$store.library.playFederatedRelease(release)">
|
||
<svg viewBox="0 0 24 24"><path d="M8 5v14l11-7z"/></svg>
|
||
</button>
|
||
</div>
|
||
<div class="card-title"><a class="artist-link" :href="$store.library.releaseHref(release)"
|
||
@click.stop x-text="release.title"></a></div>
|
||
<div class="card-subtitle">
|
||
<span x-text="release.year || ''"></span>
|
||
<span x-text="release.tracks.length + ' {{ t.player_tracks_count }}'"></span>
|
||
<span class="federation-source-count"
|
||
x-text="release.owners.length + ' peer' + (release.owners.length === 1 ? '' : 's')"></span>
|
||
</div>
|
||
</div>
|
||
</template>
|
||
</div>
|
||
</section>
|
||
</template>
|
||
<template x-if="$store.library.artistFederation.tracks.length > 0">
|
||
<section class="artist-release-group federation-artist-section">
|
||
<h2 class="artist-release-group-title">Federation tracks</h2>
|
||
<template x-for="(track, idx) in $store.library.artistFederation.tracks"
|
||
:key="track.key.content_id">
|
||
<div class="track-row federation-track-row"
|
||
@dblclick="$store.library.playFederatedTrack(track)">
|
||
<span class="track-num federation-track-status">
|
||
<template x-if="!$store.library.federationDownload(track.key.content_id) && !$store.library.federationFailure(track.key.content_id) && !$store.library.isTrackLocal(track)">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8">
|
||
<circle cx="12" cy="12" r="3"/>
|
||
<path d="M5.6 8.5a7.5 7.5 0 000 7M18.4 8.5a7.5 7.5 0 010 7"/>
|
||
</svg>
|
||
</template>
|
||
<template x-if="$store.library.federationFailure(track.key.content_id) && !$store.library.isTrackLocal(track)">
|
||
<span class="federation-error-badge"
|
||
:title="$store.library.federationFailure(track.key.content_id).message">!</span>
|
||
</template>
|
||
<template x-if="$store.library.federationDownload(track.key.content_id)">
|
||
<span class="federation-download-progress"
|
||
:class="{ indeterminate: !$store.library.federationDownload(track.key.content_id).total }">
|
||
<svg viewBox="0 0 20 20">
|
||
<circle class="progress-track" cx="10" cy="10" r="8"/>
|
||
<circle class="progress-value" cx="10" cy="10" r="8"
|
||
:style="`stroke-dashoffset: ${50.27 * (1 - $store.library.federationDownload(track.key.content_id).percent / 100)}`"/>
|
||
</svg>
|
||
<span class="progress-percent"
|
||
x-show="$store.library.federationDownload(track.key.content_id).total"
|
||
x-text="Math.round($store.library.federationDownload(track.key.content_id).percent)"></span>
|
||
<span class="federation-download-tooltip"
|
||
x-text="$store.library.federationDownloadTooltip(track.key.content_id)"></span>
|
||
</span>
|
||
</template>
|
||
</span>
|
||
<div class="track-info">
|
||
<div class="track-title" x-text="track.metadata.title"></div>
|
||
<div class="track-artists-inline">
|
||
{% include "player/track_artist_links.html" %}
|
||
</div>
|
||
<a class="artist-link search-variant-detail" :href="$store.library.releaseHref($store.library.trackRelease(track))" @click.stop @dblclick.stop x-text="track.metadata.release?.title"></a>
|
||
</div>
|
||
<span></span>
|
||
<span class="track-actions">
|
||
<button data-online-only class="like-btn"
|
||
:class="{ liked: $store.library.federationIsLiked(track) }"
|
||
@click.stop="$store.library.toggleFederationLike(track)"
|
||
title="{{ t.player_like }}">
|
||
<svg viewBox="0 0 24 24"
|
||
:fill="$store.library.federationIsLiked(track) ? 'currentColor' : 'none'"
|
||
stroke="currentColor" stroke-width="2">
|
||
<path d="M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78L12 21.23l8.84-8.84a5.5 5.5 0 000-7.78z"/>
|
||
</svg>
|
||
</button>
|
||
<button class="track-action-btn queue-insert-btn queue-next-btn"
|
||
@click.stop="$store.library.enqueueFederatedTrack(track, true)"
|
||
title="{{ t.player_play_next }}">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M5 6h10M5 12h7M5 18h10"/><path d="M17 9l4 3-4 3" fill="currentColor" stroke="none"/></svg>
|
||
</button>
|
||
{% include "player/track_actions_button.html" %}
|
||
</span>
|
||
<span class="track-duration"
|
||
x-text="formatTime(track.metadata.duration_seconds)"></span>
|
||
</div>
|
||
</template>
|
||
</section>
|
||
</template>
|
||
<template x-if="$store.library.artistFederation.error">
|
||
<div class="federation-search-status error"
|
||
x-text="$store.library.artistFederation.error"></div>
|
||
</template>
|
||
<template x-if="$store.library.currentArtist.featured_tracks && $store.library.currentArtist.featured_tracks.length > 0">
|
||
<section class="artist-release-group">
|
||
<h2 class="artist-release-group-title">{{ t.player_appears_on }}</h2>
|
||
<div class="track-list-header">
|
||
<span>#</span>
|
||
<span>{{ t.player_title }}</span>
|
||
<span></span>
|
||
<span></span>
|
||
<span style="text-align:right">{{ t.player_duration }}</span>
|
||
</div>
|
||
<template x-for="(track, idx) in $store.library.currentArtist.featured_tracks" :key="track.id">
|
||
<div class="track-row artist-appearance-row"
|
||
:class="{ playing: $store.player.currentTrack && $store.player.currentTrack.id === track.id }"
|
||
@dblclick="$store.queue.playRelease($store.library.currentArtist.featured_tracks, idx)">
|
||
<span class="track-num" x-text="idx + 1"></span>
|
||
<div class="track-info">
|
||
<button class="artist-appearance-cover"
|
||
type="button"
|
||
@click.stop="$store.library.openRelease(track.release_id)"
|
||
:title="track.release_title"
|
||
aria-label="{{ t.player_release }}">
|
||
<template x-if="track.cover_url">
|
||
<img x-artwork="track.cover_url" alt="" aria-hidden="true" loading="lazy">
|
||
</template>
|
||
<template x-if="!track.cover_url">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="12" cy="12" r="4"/></svg>
|
||
</template>
|
||
</button>
|
||
<div class="artist-appearance-copy">
|
||
<div class="track-title">
|
||
<span x-text="track.title"></span>
|
||
<span style="color:var(--text-subdued)"> · </span>
|
||
<a class="artist-link" :href="$store.library.releaseHref($store.library.trackRelease(track))" @click.stop @dblclick.stop x-text="track.release_title"></a>
|
||
</div>
|
||
<div class="track-artists-inline">
|
||
{% include "player/track_artist_links.html" %}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<span></span>
|
||
<div class="track-actions">
|
||
{% include "player/track_row_badges.html" %}
|
||
<button data-online-only data-member-only class="like-btn" :class="{ liked: $store.likes.has(track.id) }" @click.stop="$store.likes.toggle(track.id)" title="{{ t.player_like }}">
|
||
<svg viewBox="0 0 24 24" :fill="$store.likes.has(track.id) ? 'currentColor' : 'none'" stroke="currentColor" stroke-width="2"><path d="M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78L12 21.23l8.84-8.84a5.5 5.5 0 000-7.78z"/></svg>
|
||
</button>
|
||
<button class="track-action-btn queue-insert-btn queue-next-btn" @click.stop="$store.queue.addNextInQueue([track])" title="{{ t.player_play_next }}">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M5 6h10M5 12h7M5 18h10"/><path d="M17 9l4 3-4 3" fill="currentColor" stroke="none"/></svg>
|
||
</button>
|
||
{% include "player/track_actions_button.html" %}
|
||
</div>
|
||
<span class="track-duration" x-text="formatTime(track.duration_seconds)"></span>
|
||
</div>
|
||
</template>
|
||
</section>
|
||
</template>
|
||
</div>
|
||
</template>
|
||
|
||
<!-- Release Detail -->
|
||
<template x-if="$store.library.view === 'release_detail' && !$store.library.currentRelease && $store.library.releaseUnavailable">
|
||
<div class="empty-state" role="status">{{ t.player_release_unavailable }}</div>
|
||
</template>
|
||
<template x-if="$store.library.view === 'release_detail' && $store.library.currentRelease">
|
||
<div>
|
||
<div class="breadcrumb">
|
||
<a @click="$store.library.artistFilter === 'uploads' ? $store.library.goMyUploads() : $store.library.goArtists()"
|
||
x-text="$store.library.artistFilter === 'uploads' ? '{{ t.player_my_uploads }}' : '{{ t.player_global_library }}'"></a>
|
||
<span>/</span>
|
||
<template x-if="$store.library.currentRelease.artists.length > 0">
|
||
<a :href="$store.library.artistHref($store.library.currentRelease.artists[0])"
|
||
x-text="$store.library.currentRelease.artists[0].name"></a>
|
||
</template>
|
||
<span>/</span>
|
||
<span x-text="$store.library.currentRelease.title"></span>
|
||
</div>
|
||
<div class="release-header">
|
||
<div class="release-cover">
|
||
<template x-if="$store.library.currentRelease.cover_url">
|
||
<img x-artwork="$store.library.currentRelease.cover_url" alt="" aria-hidden="true"
|
||
@error="$store.library.releaseArtworkFailed($el)">
|
||
</template>
|
||
<template x-if="!$store.library.currentRelease.cover_url">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="12" cy="12" r="4"/></svg>
|
||
</template>
|
||
</div>
|
||
<div class="release-meta">
|
||
<div class="release-type">
|
||
<span x-text="$store.library.currentRelease.release_type"></span>
|
||
<span class="federation-source-count" x-show="$store.library.currentRelease.federationPeers?.length"
|
||
x-text="'{{ t.player_peers }} · ' + ($store.library.currentRelease.federationPeers?.length || 0)"></span>
|
||
<span class="federation-live-badge"
|
||
x-show="$store.library.releaseFederationLoading"
|
||
x-cloak>FEDERATION LIVE</span>
|
||
</div>
|
||
<div class="release-title-row">
|
||
<div class="release-title" x-text="$store.library.currentRelease.title"></div>
|
||
<button data-online-only class="like-btn like-btn-lg release-title-like"
|
||
:class="{ liked: $store.library.isMixedReleaseLiked($store.library.currentRelease) }"
|
||
@click.stop="$store.library.toggleMixedReleaseLike($store.library.currentRelease)"
|
||
title="{{ t.player_like }}">
|
||
<svg viewBox="0 0 24 24" :fill="$store.library.isMixedReleaseLiked($store.library.currentRelease) ? 'currentColor' : 'none'" stroke="currentColor" stroke-width="2"><path d="M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78L12 21.23l8.84-8.84a5.5 5.5 0 000-7.78z"/></svg>
|
||
</button>
|
||
</div>
|
||
<div class="release-artists">
|
||
<template x-for="(artist, artistIdx) in $store.library.currentRelease.artists" :key="artist.id || artist.name">
|
||
<span>
|
||
<template x-if="artistIdx > 0"><span>, </span></template>
|
||
<a class="artist-link"
|
||
:href="$store.library.artistHref(artist)"
|
||
x-text="artist.name"></a>
|
||
</span>
|
||
</template>
|
||
</div>
|
||
<div class="release-year" x-text="$store.library.currentRelease.year || ''"></div>
|
||
<div class="release-actions">
|
||
<div class="release-action-row release-meta-actions">
|
||
<div x-data="{ get target() { return $store.pins.target('release', $store.library.currentRelease) } }">{% include "player/pin_button.html" %}</div>
|
||
<button class="release-action-btn secondary"
|
||
@click.stop="$store.library.openReleaseInfo($store.library.currentRelease)"
|
||
:title="$store.library.releaseInfo($store.library.currentRelease)"
|
||
aria-label="{{ t.player_release_info }}">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="16" x2="12" y2="12"/><line x1="12" y1="8" x2="12.01" y2="8"/></svg>
|
||
{{ t.player_info }}
|
||
</button>
|
||
<button data-online-only data-member-only class="release-action-btn secondary release-share-btn"
|
||
x-show="!$store.library.currentRelease.federated"
|
||
@click.stop="$store.sharing.copyRelease($store.library.currentRelease, $event.currentTarget)"
|
||
title="{{ t.player_share }}"
|
||
aria-label="{{ t.player_share }}">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/><path d="M8.6 10.6l6.8-3.9M8.6 13.4l6.8 3.9"/></svg>
|
||
{{ t.player_share }}
|
||
</button>
|
||
</div>
|
||
<div class="release-action-row release-playback-actions">
|
||
<button class="release-action-btn primary" @click="$store.queue.playRelease($store.library.currentRelease.tracks, 0)">
|
||
<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8 5v14l11-7z"/></svg>
|
||
{{ t.player_play }}
|
||
</button>
|
||
<button class="release-action-btn secondary" @click="$store.queue.addToEnd($store.library.currentRelease.tracks)" title="{{ t.player_add_to_end_queue }}">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
|
||
{{ t.player_queue }}
|
||
</button>
|
||
<button class="release-action-btn secondary" @click="$store.queue.addNextInQueue($store.library.currentRelease.tracks)" title="{{ t.player_play_next }}">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M5 6h14M5 12h8M5 18h14"/><path d="M17 10l4 3-4 3" fill="currentColor" stroke="none"/></svg>
|
||
{{ t.player_next }}
|
||
</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- Track list -->
|
||
<div class="track-list-header">
|
||
<span>#</span>
|
||
<span>{{ t.player_title }}</span>
|
||
<span></span>
|
||
<span></span>
|
||
<span style="text-align:right">{{ t.player_duration }}</span>
|
||
</div>
|
||
<template x-for="(track, idx) in $store.library.currentRelease.tracks" :key="track.id">
|
||
<div class="track-row"
|
||
:data-shared-track-id="track.id"
|
||
:class="{ playing: $store.player.currentTrack && $store.player.currentTrack.id === track.id, 'shared-target': $store.sharing.isSharedTrack(track) }"
|
||
@dblclick="$store.queue.playRelease($store.library.currentRelease.tracks, idx)">
|
||
<span class="track-num federation-track-status">
|
||
<template x-if="!track.federation_pending">
|
||
<span x-text="track.track_number || (idx + 1)"></span>
|
||
</template>
|
||
<template x-if="track.federation_pending && !$store.library.federationDownload(track.content_id) && !$store.library.federationFailure(track.content_id) && !$store.library.isTrackLocal(track._federationTrack)">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8">
|
||
<circle cx="12" cy="12" r="3"/>
|
||
<path d="M5.6 8.5a7.5 7.5 0 000 7M18.4 8.5a7.5 7.5 0 010 7"/>
|
||
<path d="M2.8 5.8a11 11 0 000 12.4M21.2 5.8a11 11 0 010 12.4"/>
|
||
</svg>
|
||
</template>
|
||
<template x-if="track.federation_pending && $store.library.federationFailure(track.content_id) && !$store.library.isTrackLocal(track._federationTrack)">
|
||
<span class="federation-error-badge"
|
||
:title="$store.library.federationFailure(track.content_id).message">!</span>
|
||
</template>
|
||
<template x-if="track.federation_pending && !$store.library.federationDownload(track.content_id) && $store.library.isTrackLocal(track._federationTrack)">
|
||
<span x-text="track.track_number || (idx + 1)"></span>
|
||
</template>
|
||
<template x-if="track.federation_pending && $store.library.federationDownload(track.content_id)">
|
||
<span class="federation-download-progress"
|
||
:class="{ indeterminate: !$store.library.federationDownload(track.content_id).total }">
|
||
<svg viewBox="0 0 20 20">
|
||
<circle class="progress-track" cx="10" cy="10" r="8"/>
|
||
<circle class="progress-value" cx="10" cy="10" r="8"
|
||
:style="`stroke-dashoffset: ${50.27 * (1 - $store.library.federationDownload(track.content_id).percent / 100)}`"/>
|
||
</svg>
|
||
<span class="progress-percent"
|
||
x-show="$store.library.federationDownload(track.content_id).total"
|
||
x-text="Math.round($store.library.federationDownload(track.content_id).percent)"></span>
|
||
<span class="federation-download-tooltip"
|
||
x-text="$store.library.federationDownloadTooltip(track.content_id)"></span>
|
||
</span>
|
||
</template>
|
||
</span>
|
||
<div class="track-info">
|
||
<div class="track-title" x-text="track.title"></div>
|
||
<div class="track-artists-inline">
|
||
{% include "player/track_artist_links.html" %}
|
||
</div>
|
||
</div>
|
||
<span></span>
|
||
<div class="track-actions">
|
||
{% include "player/track_row_badges.html" %}
|
||
<button data-online-only data-member-only class="like-btn"
|
||
:class="{ liked: track.federation_pending ? $store.library.federationIsLiked(track._federationTrack) : $store.likes.has(track.id) }"
|
||
@click.stop="track.federation_pending ? $store.library.toggleFederationLike(track._federationTrack) : $store.likes.toggle(track.id)"
|
||
title="{{ t.player_like }}">
|
||
<svg viewBox="0 0 24 24"
|
||
:fill="track.federation_pending ? ($store.library.federationIsLiked(track._federationTrack) ? 'currentColor' : 'none') : ($store.likes.has(track.id) ? 'currentColor' : 'none')"
|
||
stroke="currentColor" stroke-width="2"><path d="M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78L12 21.23l8.84-8.84a5.5 5.5 0 000-7.78z"/></svg>
|
||
</button>
|
||
<button class="track-action-btn queue-insert-btn queue-next-btn" @click.stop="$store.queue.addNextInQueue([track])" title="{{ t.player_play_next }}">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M5 6h10M5 12h7M5 18h10"/><path d="M17 9l4 3-4 3" fill="currentColor" stroke="none"/></svg>
|
||
</button>
|
||
{% include "player/track_actions_button.html" %}
|
||
</div>
|
||
<span class="track-duration" x-text="formatTime(track.duration_seconds)"></span>
|
||
</div>
|
||
</template>
|
||
</div>
|
||
</template>
|
||
|
||
<!-- Playlist Detail -->
|
||
<template x-if="$store.library.view === 'playlist_detail' && $store.library.playlistUnavailable && !$store.library.currentPlaylist">
|
||
<div class="empty-state" role="status">{{ t.player_playlist_unavailable }}</div>
|
||
</template>
|
||
<template x-if="$store.library.view === 'playlist_detail' && $store.library.currentPlaylist">
|
||
<div class="playlist-detail-view" x-data="playlistTrackFilter" x-effect="setPlaylist($store.library.currentPlaylist)">
|
||
<div class="breadcrumb">
|
||
<a @click="$store.library.goArtists()">{{ t.player_library }}</a>
|
||
<span>/</span>
|
||
<span x-text="$store.playlists.displayTitle($store.library.currentPlaylist)"></span>
|
||
</div>
|
||
{% include "player/playlist_header.html" %}
|
||
<div class="playlist-search-toolbar" role="search" aria-label="{{ t.player_playlist_search }}">
|
||
<span class="playlist-match-count" role="status" x-show="query.trim() && matchCount" x-cloak
|
||
x-text="formatArtistCount(matchCount, 'tracks')"></span>
|
||
<div class="playlist-search-field">
|
||
<svg viewBox="0 0 20 20" aria-hidden="true"><circle cx="8.5" cy="8.5" r="5.5"/><path d="m13 13 4 4"/></svg>
|
||
<input id="playlist-track-search" type="search" x-ref="playlistSearch" autocomplete="off" spellcheck="false"
|
||
aria-label="{{ t.player_playlist_search }}" placeholder="{{ t.player_playlist_search }}"
|
||
aria-controls="playlist-filter-rows" :value="query"
|
||
@input="if (!$event.isComposing) setQuery($el.value)" @compositionend="setQuery($el.value)"
|
||
@keydown.escape.stop="if (!$event.isComposing) { if (query) { $event.preventDefault(); setQuery('') } else $el.blur() }"
|
||
@keydown.space.stop>
|
||
<button class="playlist-search-clear" type="button" x-show="query" x-cloak
|
||
aria-label="{{ t.player_clear_playlist_search }}" title="{{ t.player_clear_playlist_search }}"
|
||
@click="setQuery(''); $refs.playlistSearch.focus()">
|
||
<svg viewBox="0 0 20 20" aria-hidden="true"><path d="m5.5 5.5 9 9m0-9-9 9"/></svg>
|
||
</button>
|
||
</div>
|
||
</div>
|
||
<div class="track-list-header playlist-track-list-header"
|
||
:class="{ editing: $store.playlists.isEditingCurrent() }">
|
||
<span class="playlist-edit-cell"
|
||
x-show="$store.playlists.isEditingCurrent()"
|
||
x-cloak></span>
|
||
<span>#</span>
|
||
<span>{{ t.player_title }}</span>
|
||
<span></span>
|
||
<span></span>
|
||
<span style="text-align:right">{{ t.player_duration }}</span>
|
||
</div>
|
||
<div id="playlist-filter-rows" x-ref="trackList">
|
||
<template x-for="{track, idx, key, leaving, entering} in visibleRows" :key="key">
|
||
<div class="playlist-filter-row" :class="{'is-leaving':leaving, 'is-entering':entering}"
|
||
:aria-hidden="leaving ? 'true' : null" :inert="leaving ? true : null">
|
||
<div class="playlist-filter-clip">
|
||
{% include "player/playlist_track_row.html" %}
|
||
</div>
|
||
</div>
|
||
</template>
|
||
</div>
|
||
<p class="playlist-search-empty" role="status" x-show="query.trim() && !matchCount" x-cloak>
|
||
{{ t.player_playlist_no_matches }}
|
||
</p>
|
||
</div>
|
||
</template>
|
||
</div>
|
||
|
||
<!-- Queue Panel -->
|
||
<div class="queue-backdrop"
|
||
x-show="$store.queue.visible"
|
||
x-cloak
|
||
@click="$store.queue.visible = false"></div>
|
||
<div class="queue-panel" :class="{ hidden: !$store.queue.visible }">
|
||
<div class="queue-header">
|
||
<h3>{{ t.player_queue }}</h3>
|
||
<div class="queue-header-actions">
|
||
<button data-online-only data-member-only class="queue-share-btn" @click="$store.sharing.copyQueue($event.currentTarget)" :disabled="$store.queue.tracks.length === 0" title="{{ t.player_share_queue }}" aria-label="{{ t.player_share_queue }}">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/><path d="M8.6 10.6l6.8-3.9M8.6 13.4l6.8 3.9"/></svg>
|
||
</button>
|
||
<button class="queue-clear-btn" @click="$store.queue.clear()">{{ t.player_clear }}</button>
|
||
</div>
|
||
</div>
|
||
<div class="queue-tracks">
|
||
<template x-if="$store.queue.displayItems().length === 0">
|
||
<div class="empty-state">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M9 18V5l12-2v13"/><circle cx="6" cy="18" r="3"/><circle cx="18" cy="16" r="3"/></svg>
|
||
<p>{{ t.player_queue_empty }}</p>
|
||
</div>
|
||
</template>
|
||
<template x-for="item in $store.queue.displayItems()" :key="item.key">
|
||
<div class="queue-track"
|
||
:data-queue-index="item.index"
|
||
:class="{ active: item.state === 'current', current: item.state === 'current', played: item.state === 'played', dragging: $store.queue._dragIdx === item.index, synthetic: item.synthetic, 'foreign-jam-track': $store.queue.isForeignJamTrack(item.track) }"
|
||
:style="$store.queue.isForeignJamTrack(item.track) ? $store.queue.contributorStyle(item.track) : ''"
|
||
@click="item.index >= 0 ? $store.queue.playFromIndex(item.index) : $store.player.play(item.track)"
|
||
:draggable="!item.synthetic"
|
||
@dragstart="if (item.synthetic) { $event.preventDefault(); } else { $store.queue._dragIdx = item.index; $event.dataTransfer.effectAllowed = 'move'; }"
|
||
@dragend="$store.queue._dragIdx = null; document.querySelectorAll('.drag-over').forEach(el => el.classList.remove('drag-over'))"
|
||
@dragover.prevent="$event.dataTransfer.dropEffect = 'move'; $event.currentTarget.classList.add('drag-over')"
|
||
@dragleave="$event.currentTarget.classList.remove('drag-over')"
|
||
@drop.prevent="$event.currentTarget.classList.remove('drag-over'); if (!item.synthetic && $store.queue._dragIdx !== null) { $store.queue.moveTrack($store.queue._dragIdx, item.index); $store.queue._dragIdx = null; }">
|
||
<div class="queue-drag-handle"
|
||
x-show="!item.synthetic"
|
||
@mousedown.stop
|
||
@click.stop
|
||
@pointerdown.stop="$store.queue.startPointerReorder($event, item.index)">
|
||
<svg viewBox="0 0 24 24" fill="currentColor"><circle cx="9" cy="6" r="1.5"/><circle cx="15" cy="6" r="1.5"/><circle cx="9" cy="12" r="1.5"/><circle cx="15" cy="12" r="1.5"/><circle cx="9" cy="18" r="1.5"/><circle cx="15" cy="18" r="1.5"/></svg>
|
||
</div>
|
||
<div class="queue-track-cover">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M9 18V5l12-2v13"/><circle cx="6" cy="18" r="3"/><circle cx="18" cy="16" r="3"/></svg>
|
||
<template x-if="item.track.cover_url">
|
||
<img class="artwork-image" x-artwork="item.track.cover_url" alt="" aria-hidden="true" loading="lazy">
|
||
</template>
|
||
<span class="queue-federation-status federation-track-status"
|
||
x-show="item.track.federation_pending"
|
||
x-cloak>
|
||
<template x-if="!$store.library.federationDownload(item.track.content_id) && !$store.library.federationFailure(item.track.content_id)">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8">
|
||
<circle cx="12" cy="12" r="3"/>
|
||
<path d="M5.6 8.5a7.5 7.5 0 000 7M18.4 8.5a7.5 7.5 0 010 7"/>
|
||
</svg>
|
||
</template>
|
||
<template x-if="$store.library.federationFailure(item.track.content_id)">
|
||
<span class="federation-error-badge"
|
||
:title="$store.library.federationFailure(item.track.content_id).message">!</span>
|
||
</template>
|
||
<template x-if="$store.library.federationDownload(item.track.content_id)">
|
||
<span class="federation-download-progress"
|
||
:class="{ indeterminate: !$store.library.federationDownload(item.track.content_id).total }">
|
||
<svg viewBox="0 0 20 20">
|
||
<circle class="progress-track" cx="10" cy="10" r="8"/>
|
||
<circle class="progress-value" cx="10" cy="10" r="8"
|
||
:style="`stroke-dashoffset: ${50.27 * (1 - $store.library.federationDownload(item.track.content_id).percent / 100)}`"/>
|
||
</svg>
|
||
<span class="progress-percent"
|
||
x-show="$store.library.federationDownload(item.track.content_id).total"
|
||
x-text="Math.round($store.library.federationDownload(item.track.content_id).percent)"></span>
|
||
<span class="federation-download-tooltip"
|
||
x-text="$store.library.federationDownloadTooltip(item.track.content_id)"></span>
|
||
</span>
|
||
</template>
|
||
</span>
|
||
</div>
|
||
<div class="queue-track-info">
|
||
<div class="queue-track-title" x-text="item.track.title"></div>
|
||
<div class="queue-track-artist">
|
||
<template x-for="(artist, artistIdx) in $store.library.trackArtistLinks(item.track)" :key="artist.href + '-' + artistIdx">
|
||
<span>
|
||
<template x-if="artistIdx > 0"><span>, </span></template>
|
||
<a class="artist-link"
|
||
:href="artist.href" @click.stop @dblclick.stop
|
||
x-text="artist.label"></a>
|
||
</span>
|
||
</template>
|
||
</div>
|
||
</div>
|
||
<div class="queue-track-actions" x-data="{ get track() { return item.track } }">
|
||
<template x-if="!track.podcast && !track.podcast_source && !track.unavailable">
|
||
<span class="queue-track-music-actions">
|
||
{% include "player/track_row_badges.html" %}
|
||
{% include "player/track_actions_button.html" %}
|
||
</span>
|
||
</template>
|
||
<button class="queue-track-remove" x-show="!item.synthetic" @click.stop="$store.queue.remove(item.index)" title="{{ t.player_remove }}">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="14" height="14"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
|
||
</button>
|
||
</div>
|
||
</div>
|
||
</template>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Player Bar -->
|
||
<div class="player-bar" @keydown.space.stop
|
||
:class="{ 'mobile-expanded': $store.mobile.playerExpanded }">
|
||
<div class="mobile-full-player">
|
||
<button class="mobile-player-collapse-btn" type="button" @click.stop="$store.mobile.closePlayerFullscreen()" title="{{ t.player_close }}" aria-label="{{ t.player_close }}">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4">
|
||
<path d="M6 9l6 6 6-6"/>
|
||
</svg>
|
||
</button>
|
||
<div class="player-now-playing">
|
||
<template x-if="$store.player.currentTrack">
|
||
<div class="player-current-track" x-data="playerCoverPreview"
|
||
x-effect="if (!artwork) closePreview()"
|
||
@keydown.escape.window="if (visible) closePreview()"
|
||
@click.window.capture="if (visible && !$event.target.closest('.player-cover, .player-cover-preview')) closePreview()">
|
||
<button type="button" class="player-cover"
|
||
aria-label="{{ t.player_album_cover }}" aria-controls="player-cover-preview"
|
||
:aria-expanded="visible" :disabled="!artwork && !$store.mobile.isMobilePlayer()"
|
||
@pointerenter="hover($event)" @pointerleave="leave($event)"
|
||
@keydown.space.stop @click.stop="activate($event)">
|
||
<template x-if="$store.player.currentTrack.cover_url">
|
||
<img x-artwork="$store.player.currentTrack.cover_url" alt="" aria-hidden="true">
|
||
</template>
|
||
<template x-if="!$store.player.currentTrack.cover_url">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M9 18V5l12-2v13"/><circle cx="6" cy="18" r="3"/><circle cx="18" cy="16" r="3"/></svg>
|
||
</template>
|
||
</button>
|
||
<template x-teleport="body">
|
||
<div id="player-cover-preview" class="player-cover-preview" x-cloak x-show="visible && artwork"
|
||
:class="{ 'player-cover-preview-centered': $store.mobile.playerExpanded }"
|
||
@pointerenter="hover($event)" @pointerleave="leave($event)" @click="pin()">
|
||
<template x-if="visible && artwork">
|
||
<img x-artwork="coverVariantUrl(artwork, 'large')" :alt="$store.player.currentTrack?.release_title || $store.player.currentTrack?.title"
|
||
@error="if (!$store.offline.localArtworkOnly && $el.getAttribute('src') !== artwork) $el.src = artwork; else closePreview()">
|
||
</template>
|
||
</div>
|
||
</template>
|
||
<div class="player-track-info">
|
||
<div class="player-track-title" x-text="$store.player.currentTrack.title"></div>
|
||
<div class="player-track-artist">
|
||
<template x-for="(artist, artistIdx) in $store.library.trackArtistLinks($store.player.currentTrack)" :key="artist.href + '-' + artistIdx">
|
||
<span>
|
||
<template x-if="artistIdx > 0"><span>, </span></template>
|
||
<a class="artist-link" :href="artist.href"
|
||
@click.stop="if ($store.library.followsHere($event) && $store.mobile.playerExpanded) $store.mobile.closePlayerFullscreen()"
|
||
x-text="artist.label"></a>
|
||
</span>
|
||
</template>
|
||
<template x-if="$store.player.currentTrack.release_year">
|
||
<span class="player-release-year" x-text="' · ' + $store.player.currentTrack.release_year"></span>
|
||
</template>
|
||
</div>
|
||
<div class="player-track-release" x-show="$store.player.currentTrack.release_title">
|
||
<a class="artist-link" :href="$store.library.releaseHref($store.library.trackRelease($store.player.currentTrack))"
|
||
@click.stop="if ($store.library.followsHere($event) && $store.mobile.playerExpanded) $store.mobile.closePlayerFullscreen()"
|
||
x-text="$store.player.currentTrack.release_title"></a>
|
||
</div>
|
||
</div>
|
||
<div class="player-current-actions" data-member-only data-online-only>
|
||
<button data-online-only class="like-btn player-current-like"
|
||
:class="{ liked: $store.likes.has($store.player.currentTrack.id) }"
|
||
@click.stop="$store.likes.toggle($store.player.currentTrack.id)"
|
||
title="{{ t.player_like }}"
|
||
aria-label="{{ t.player_like }}">
|
||
<svg viewBox="0 0 24 24" :fill="$store.likes.has($store.player.currentTrack.id) ? 'currentColor' : 'none'" stroke="currentColor" stroke-width="2"><path d="M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78L12 21.23l8.84-8.84a5.5 5.5 0 000-7.78z"/></svg>
|
||
</button>
|
||
<button class="track-action-btn player-current-share"
|
||
@click.stop="$store.sharing.copyTrack($store.player.currentTrack, $event.currentTarget)"
|
||
title="{{ t.player_share_track }}"
|
||
aria-label="{{ t.player_share_track }}">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/><path d="M8.6 10.6l6.8-3.9M8.6 13.4l6.8 3.9"/></svg>
|
||
</button>
|
||
<button type="button" class="track-action-btn player-current-similar"
|
||
x-show="$store.library.similarityTrackId($store.player.currentTrack)"
|
||
@keydown.space.stop @click.stop="$store.library.searchSimilar($store.player.currentTrack)"
|
||
title="{{ t.player_find_similar }}" aria-label="{{ t.player_find_similar }}">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="10" cy="10" r="7.5"/><path d="m16 16 5 5M5.5 10h2l1.3-3 2.2 6 1.5-3h2"/></svg>
|
||
</button>
|
||
</div>
|
||
</div>
|
||
</template>
|
||
</div>
|
||
|
||
<div class="player-controls">
|
||
<div class="player-buttons">
|
||
<button class="player-btn player-btn-shuffle" :aria-pressed="$store.player.shuffle" :class="{ active: $store.player.shuffle }" @click="$store.player.toggleShuffle()" title="{{ t.player_shuffle }}">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="16 3 21 3 21 8"/><line x1="4" y1="20" x2="21" y2="3"/><polyline points="21 16 21 21 16 21"/><line x1="15" y1="15" x2="21" y2="21"/><line x1="4" y1="4" x2="9" y2="9"/></svg>
|
||
</button>
|
||
<button class="player-btn player-btn-prev" @click="$store.player.prev()" title="{{ t.player_previous }}">
|
||
<svg viewBox="0 0 24 24" fill="currentColor"><path d="M6 6h2v12H6zm3.5 6l8.5 6V6z"/></svg>
|
||
</button>
|
||
<button class="player-btn player-btn-play" :aria-label="$store.player.isPlaying ? '{{ t.player_pause }}' : '{{ t.player_play }}'" @click="$store.player.toggle()">
|
||
<template x-if="!$store.player.isPlaying">
|
||
<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8 5v14l11-7z"/></svg>
|
||
</template>
|
||
<template x-if="$store.player.isPlaying">
|
||
<svg viewBox="0 0 24 24" fill="currentColor"><path d="M6 4h4v16H6zM14 4h4v16h-4z"/></svg>
|
||
</template>
|
||
</button>
|
||
<button class="player-btn player-btn-next" @click="$store.player.next()" title="{{ t.player_next }}">
|
||
<svg viewBox="0 0 24 24" fill="currentColor"><path d="M6 18l8.5-6L6 6v12zM16 6v12h2V6h-2z"/></svg>
|
||
</button>
|
||
<button class="player-btn player-btn-repeat" :aria-pressed="$store.player.repeatMode !== 'off'" :class="{ active: $store.player.repeatMode !== 'off' }" @click="$store.player.cycleRepeat()" title="{{ t.player_repeat }}">
|
||
<template x-if="$store.player.repeatMode !== 'one'">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="17 1 21 5 17 9"/><path d="M3 11V9a4 4 0 014-4h14"/><polyline points="7 23 3 19 7 15"/><path d="M21 13v2a4 4 0 01-4 4H3"/></svg>
|
||
</template>
|
||
<template x-if="$store.player.repeatMode === 'one'">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="17 1 21 5 17 9"/><path d="M3 11V9a4 4 0 014-4h14"/><polyline points="7 23 3 19 7 15"/><path d="M21 13v2a4 4 0 01-4 4H3"/><text x="12" y="14" font-size="8" fill="currentColor" text-anchor="middle" font-weight="bold">1</text></svg>
|
||
</template>
|
||
</button>
|
||
</div>
|
||
<div class="player-timeline">
|
||
<span class="player-time" x-text="formatTime($store.player.currentTime)"></span>
|
||
<input type="range" class="player-slider progress-bar" min="0" :max="$store.player.duration || 1" step="1"
|
||
:value="$store.player.currentTime" :disabled="!$store.player.duration"
|
||
:style="'--filled:' + $store.player.progress + '%'"
|
||
aria-label="{{ t.player_seek }}" :aria-valuetext="formatTime($store.player.currentTime)"
|
||
@input="$store.player.seek(Number($el.value))">
|
||
<span class="player-time" x-text="formatTime($store.player.duration)"></span>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="player-right">
|
||
<button class="player-btn lyrics-toggle" type="button" @click.stop="$store.lyrics.open($store.player.currentTrack,true)" :disabled="!$store.player.currentTrack || !!$store.player.currentTrack.podcast" :title="$store.lyrics.text('lyrics')" :aria-label="$store.lyrics.text('lyrics')">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true"><rect x="4" y="3" width="16" height="18" rx="3"/><path d="M8 8h8M8 12h6M8 16h4"/></svg>
|
||
</button>
|
||
<div class="volume-control">
|
||
<button class="volume-btn" :aria-label="$store.player.volume ? '{{ t.player_mute }}' : '{{ t.player_unmute }}'" @click="$store.player.toggleMute()">
|
||
<template x-if="$store.player.volume === 0">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/><line x1="23" y1="9" x2="17" y2="15"/><line x1="17" y1="9" x2="23" y2="15"/></svg>
|
||
</template>
|
||
<template x-if="$store.player.volume > 0 && $store.player.volume < 0.5">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/><path d="M15.54 8.46a5 5 0 010 7.07"/></svg>
|
||
</template>
|
||
<template x-if="$store.player.volume >= 0.5">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/><path d="M19.07 4.93a10 10 0 010 14.14M15.54 8.46a5 5 0 010 7.07"/></svg>
|
||
</template>
|
||
</button>
|
||
<input type="range" class="player-slider volume-slider" min="0" max="100" step="1"
|
||
:value="$store.player.volumeSliderPercent()" :style="'--filled:' + $store.player.volumeSliderPercent() + '%'"
|
||
aria-label="{{ t.player_volume }}" :aria-valuetext="Math.round($store.player.volumeSliderPercent()) + '%'"
|
||
@input="$store.player.setVolume($store.player._volumeFromSliderPosition(Number($el.value) / 100))">
|
||
</div>
|
||
<button class="queue-toggle-btn" :class="{ active: $store.queue.visible }" @click="$store.queue.visible = !$store.queue.visible" title="{{ t.player_queue }}">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="8" y1="6" x2="21" y2="6"/><line x1="8" y1="12" x2="21" y2="12"/><line x1="8" y1="18" x2="21" y2="18"/><line x1="3" y1="6" x2="3.01" y2="6"/><line x1="3" y1="12" x2="3.01" y2="12"/><line x1="3" y1="18" x2="3.01" y2="18"/></svg>
|
||
</button>
|
||
<div class="device-picker" @click.outside="$store.devices.open = false">
|
||
<template x-if="$store.devices.remoteHintVisible">
|
||
<button data-online-only data-member-only class="remote-playback-hint"
|
||
type="button"
|
||
@click="$store.devices.dismissRemoteHint()"
|
||
x-transition
|
||
x-cloak>
|
||
<span class="remote-playback-hint-text" x-text="$store.devices.remoteHintText()"></span>
|
||
<span class="remote-playback-hint-progress"></span>
|
||
</button>
|
||
</template>
|
||
<button data-member-only class="queue-toggle-btn device-toggle-btn"
|
||
:class="{ active: $store.devices.isActive() }"
|
||
@click="$store.devices.toggle()"
|
||
:title="$store.offline.active ? '{{ t.player_offline_devices }}' : $store.devices.activeLabel()"
|
||
aria-label="Devices">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||
<rect x="3" y="4" width="18" height="12" rx="2"/>
|
||
<path d="M8 20h8"/>
|
||
<path d="M12 16v4"/>
|
||
</svg>
|
||
<span data-online-only class="jam-member-squares"
|
||
x-show="$store.devices.activeJamMembers().length > 0"
|
||
x-cloak>
|
||
<template x-for="member in $store.devices.activeJamMembers().slice(0, 8)" :key="'device-jam-member-' + member.user_id">
|
||
<span class="jam-member-square" :style="$store.devices.userColorStyle(member.user_id, member.name)"></span>
|
||
</template>
|
||
</span>
|
||
</button>
|
||
<div class="device-popover" x-show="$store.devices.open" x-transition x-cloak>
|
||
<p class="offline-devices-note" data-offline-only>{{ t.player_offline_devices }}</p>
|
||
<div class="device-section-label">Web players</div>
|
||
<template x-for="device in $store.devices.webDevices()" :key="device.id">
|
||
<button data-member-only class="device-row"
|
||
:class="{ active: device.is_active, 'current-device': device.is_current }"
|
||
@click="$store.devices.select(device.id)">
|
||
<span class="device-row-icon">
|
||
<template x-if="device.kind === 'phone'">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||
<rect x="7" y="2" width="10" height="20" rx="2"/>
|
||
<path d="M11 18h2"/>
|
||
</svg>
|
||
</template>
|
||
<template x-if="device.kind !== 'phone'">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||
<rect x="3" y="4" width="18" height="12" rx="2"/>
|
||
<path d="M8 20h8"/>
|
||
<path d="M12 16v4"/>
|
||
</svg>
|
||
</template>
|
||
</span>
|
||
<span class="device-row-main">
|
||
<span class="device-row-name" x-text="device.name"></span>
|
||
<span class="device-row-current" x-show="device.is_current">This device</span>
|
||
</span>
|
||
<span class="device-row-check" x-show="device.is_active">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4">
|
||
<polyline points="20 6 9 17 4 12"/>
|
||
</svg>
|
||
</span>
|
||
</button>
|
||
</template>
|
||
<template x-if="$store.devices.playbackFedDevices().length > 0">
|
||
<div class="device-group-divider">
|
||
<span>Trusted federation devices</span>
|
||
</div>
|
||
</template>
|
||
<template x-for="device in $store.devices.playbackFedDevices()" :key="device.id">
|
||
<button data-member-only class="device-row federation-device-row"
|
||
:class="{ active: device.is_active }"
|
||
@click="$store.devices.select(device.id)">
|
||
<span class="device-row-icon federation-device-icon">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8">
|
||
<circle cx="12" cy="12" r="3"/>
|
||
<path d="M5.6 8.5a7.5 7.5 0 000 7M18.4 8.5a7.5 7.5 0 010 7"/>
|
||
<path d="M2.8 5.8a11 11 0 000 12.4M21.2 5.8a11 11 0 010 12.4"/>
|
||
</svg>
|
||
</span>
|
||
<span class="device-row-main">
|
||
<span class="device-row-name" x-text="device.name"></span>
|
||
<span class="device-row-current"
|
||
x-text="device.is_active ? 'Active federation device' : 'Available for playback transfer'"></span>
|
||
</span>
|
||
<span class="device-row-check" x-show="device.is_active">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4">
|
||
<polyline points="20 6 9 17 4 12"/>
|
||
</svg>
|
||
</span>
|
||
</button>
|
||
</template>
|
||
<template x-if="$store.devices.jams.length > 0">
|
||
<div class="device-section-label jam-section-label">Jams</div>
|
||
</template>
|
||
<template x-for="jam in $store.devices.jams" :key="jam.id">
|
||
<button data-member-only class="device-row jam-row"
|
||
:class="{ active: jam.is_active, pending: jam.is_pending }"
|
||
@click="$store.devices.handleJamRowClick(jam)">
|
||
<span class="device-row-icon">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||
<circle cx="8" cy="8" r="3"/>
|
||
<circle cx="16" cy="8" r="3"/>
|
||
<path d="M4 20v-1a4 4 0 014-4h0a4 4 0 014 4v1"/>
|
||
<path d="M12 20v-1a4 4 0 014-4h0a4 4 0 014 4v1"/>
|
||
</svg>
|
||
</span>
|
||
<span class="device-row-main">
|
||
<span class="device-row-name" x-text="jam.name"></span>
|
||
<span class="device-row-current"
|
||
x-text="!jam.host_device_online ? 'Host offline' : (jam.is_pending ? 'Invite pending' : (jam.is_owner ? 'Your Jam' : 'Shared queue'))"></span>
|
||
</span>
|
||
<span class="device-row-check" x-show="jam.is_active">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4">
|
||
<polyline points="20 6 9 17 4 12"/>
|
||
</svg>
|
||
</span>
|
||
</button>
|
||
</template>
|
||
<button data-member-only class="device-row start-jam-row" x-show="!$store.devices.hasJoinedJam()" @click="$store.devices.openJamPanel()">
|
||
<span class="device-row-icon">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||
<path d="M12 5v14"/>
|
||
<path d="M5 12h14"/>
|
||
</svg>
|
||
</span>
|
||
<span class="device-row-main">
|
||
<span class="device-row-name">Start Jam</span>
|
||
<span class="device-row-current">Invite listeners</span>
|
||
</span>
|
||
</button>
|
||
<div class="jam-create-panel" x-show="$store.devices.jamPanelOpen" x-transition x-cloak>
|
||
<div class="jam-panel-title" x-text="$store.devices.jamPanelMode === 'manage' ? 'Invite listeners' : 'Start Jam'"></div>
|
||
<label class="jam-local-playback-toggle"
|
||
x-show="$store.devices.jamPanelMode === 'manage' && $store.devices.canPlayJamLocally()"
|
||
x-cloak>
|
||
<input type="checkbox"
|
||
:checked="$store.devices.jamLocalPlayback"
|
||
@change="$store.devices.setJamLocalPlayback($event.target.checked)">
|
||
<span>{{ t.player_jam_play_on_this_device }}</span>
|
||
</label>
|
||
<div class="jam-selected-users" x-show="$store.devices.jamSelectedUsers.length > 0">
|
||
<template x-for="user in $store.devices.jamSelectedUsers" :key="user.id">
|
||
<button data-member-only class="jam-user-chip" @click="$store.devices.removeJamInvitee(user.id)">
|
||
<span x-text="user.display_name || user.username"></span>
|
||
<span aria-hidden="true">×</span>
|
||
</button>
|
||
</template>
|
||
</div>
|
||
<input class="jam-user-search"
|
||
type="search"
|
||
placeholder="Search users"
|
||
x-model="$store.devices.jamQuery"
|
||
@input="$store.devices.queueJamSearch()">
|
||
<div class="jam-search-results" x-show="$store.devices.jamUsers.length > 0">
|
||
<template x-for="user in $store.devices.jamUsers" :key="user.id">
|
||
<button data-member-only class="jam-search-row" @click="$store.devices.addJamInvitee(user)">
|
||
<span x-text="user.display_name || user.username"></span>
|
||
<small x-text="user.email || user.username"></small>
|
||
</button>
|
||
</template>
|
||
</div>
|
||
<div class="jam-panel-actions">
|
||
<button data-member-only class="jam-create-btn"
|
||
:disabled="$store.devices.jamSelectedUsers.length === 0 && $store.devices.jamPanelMode === 'manage'"
|
||
@click="$store.devices.submitJamPanel()"
|
||
x-text="$store.devices.jamPanelMode === 'manage' ? 'Invite' : 'Create Jam'"></button>
|
||
<button data-member-only class="jam-leave-btn"
|
||
x-show="$store.devices.jamPanelMode === 'manage'"
|
||
@click="$store.devices.leaveJam($store.devices.jamPanelJamId)">Leave</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="mobile-expanded-queue">
|
||
<div class="mobile-expanded-queue-title">{{ t.player_queue }}</div>
|
||
<template x-if="$store.queue.displayItems().length === 0">
|
||
<div class="mobile-expanded-queue-empty">{{ t.player_queue_empty }}</div>
|
||
</template>
|
||
<template x-for="item in $store.queue.displayItems()" :key="'mobile-expanded-queue-' + item.key">
|
||
<div class="mobile-expanded-queue-row"
|
||
:class="{ current: item.state === 'current', played: item.state === 'played', 'foreign-jam-track': $store.queue.isForeignJamTrack(item.track) }"
|
||
:style="$store.queue.isForeignJamTrack(item.track) ? $store.queue.contributorStyle(item.track) : ''">
|
||
<div class="mobile-expanded-queue-cover">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M9 18V5l12-2v13"/><circle cx="6" cy="18" r="3"/><circle cx="18" cy="16" r="3"/></svg>
|
||
<template x-if="item.track.cover_url">
|
||
<img class="artwork-image" x-artwork="item.track.cover_url" alt="" aria-hidden="true" loading="lazy">
|
||
</template>
|
||
</div>
|
||
<div class="mobile-expanded-queue-info">
|
||
<button class="mobile-expanded-queue-name" type="button"
|
||
@click="item.index >= 0 ? $store.queue.playFromIndex(item.index) : $store.player.play(item.track)"
|
||
x-text="item.track.title"></button>
|
||
<div class="mobile-expanded-queue-artist">
|
||
<template x-for="(artist, artistIdx) in $store.library.trackArtistLinks(item.track)" :key="artist.href + '-' + artistIdx">
|
||
<span>
|
||
<template x-if="artistIdx > 0"><span>, </span></template>
|
||
<a class="artist-link" :href="artist.href" @click.stop="if ($store.library.followsHere($event)) $store.mobile.closePlayerFullscreen()" x-text="artist.label"></a>
|
||
</span>
|
||
</template>
|
||
</div>
|
||
</div>
|
||
<span class="mobile-expanded-queue-time" x-text="formatTime(item.track.duration_seconds)"></span>
|
||
</div>
|
||
</template>
|
||
</div>
|
||
</div>
|
||
</div>
|