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>
63 lines
4.6 KiB
HTML
63 lines
4.6 KiB
HTML
{% if share_token.is_empty() %}
|
|
<section class="offline-account" aria-label="{{ t.player_offline_listening }}" x-data="{get offline() { return $store.offline }}" @keydown.space.stop>
|
|
<div class="offline-account-summary">
|
|
<div aria-live="polite">
|
|
<strong x-text="!offline.enabled ? '{{ t.player_offline_disabled }}' : offline.manual ? '{{ t.player_offline_manual }}' : offline.active ? '{{ t.player_offline_auto }}' : '{{ t.player_offline_online }}'"></strong>
|
|
<small x-show="offline.enabled || offline.bytes" x-text="offline.formatBytes(offline.bytes) + ' / ' + offline.formatBytes(offline.limitBytes)"></small>
|
|
</div>
|
|
<button type="button" class="offline-manage" title="{{ t.player_offline_manage_label }}" aria-label="{{ t.player_offline_manage_label }}"
|
|
@click="$store.user.openSettings('offline-settings-title')">{{ t.player_offline_manage }}</button>
|
|
</div>
|
|
<progress class="offline-account-meter" x-show="offline.enabled || offline.bytes" x-cloak
|
|
:max="offline.limitBytes" :value="offline.bytes" aria-label="{{ t.player_offline_used }}"
|
|
:aria-valuetext="offline.formatBytes(offline.bytes) + ' / ' + offline.formatBytes(offline.limitBytes)"></progress>
|
|
<div class="offline-mode-control" x-show="offline.enabled" x-cloak x-data="{ helpOpen:false }" x-id="['offline-mode', 'offline-hint']"
|
|
@click.outside="helpOpen = false" @keydown.escape="if (helpOpen) { $event.stopPropagation(); helpOpen = false }">
|
|
<label :for="$id('offline-mode')">{{ t.player_offline_mode }}</label>
|
|
<button type="button" class="offline-mode-info" aria-label="{{ t.player_info }}"
|
|
:aria-describedby="$id('offline-hint')" @mouseenter="helpOpen = true" @mouseleave="helpOpen = false"
|
|
@focus="helpOpen = true" @blur="helpOpen = false" @click="helpOpen = true">
|
|
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true">
|
|
<circle cx="10" cy="10" r="7.25"/><path d="M10 9v4.25"/><circle cx="10" cy="6.5" r=".9" fill="currentColor" stroke="none"/>
|
|
</svg>
|
|
</button>
|
|
<span role="tooltip" class="offline-mode-hint" :id="$id('offline-hint')" x-show="helpOpen" x-cloak>{{ t.player_offline_mode_hint }}</span>
|
|
<button type="button" role="switch" class="offline-switch-row" :id="$id('offline-mode')" :aria-describedby="$id('offline-hint')"
|
|
:aria-checked="offline.manual" :disabled="offline.busy" @click="helpOpen = false; offline.setManual(!offline.manual)">
|
|
<span class="offline-switch" aria-hidden="true"></span>
|
|
</button>
|
|
</div>
|
|
</section>
|
|
{% endif %}
|
|
<div class="account-action-list" @click="if ($event.target.closest('a[href]')) $store.user.menuOpen = false">
|
|
<a data-online-only href="#listening" :aria-current="$store.library.view === 'listening' ? 'page' : null">
|
|
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 20V12M9 20V6M14 20V3M19 20V9"/></svg>
|
|
{{ t.player_my_listening }}
|
|
</a>
|
|
<a href="#followed" :aria-current="$store.library.view === 'followed' ? 'page' : null">
|
|
<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="9" cy="8" r="3.5"/><path d="M2.5 20a6.5 6.5 0 0 1 13 0m.5-9 2.5 2.5L23 9"/></svg>
|
|
{{ t.player_followed_page }}
|
|
</a>
|
|
<a data-online-only href="#imports" :aria-current="['imports', 'import_detail'].includes($store.library.view) ? 'page' : null">
|
|
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3v11m-4-4 4 4 4-4M5 14v6h14v-6"/></svg>
|
|
{{ t.player_import_library }}
|
|
</a>
|
|
<button type="button" @click="$store.user.openSettings()">
|
|
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 6h9m4 0h3M4 12h2m4 0h10M4 18h8m4 0h4"/><circle cx="15" cy="6" r="2"/><circle cx="8" cy="12" r="2"/><circle cx="14" cy="18" r="2"/></svg>
|
|
{{ t.nav_settings }}
|
|
</button>
|
|
<button type="button" aria-haspopup="dialog" aria-controls="get-app-dialog"
|
|
@click="$store.user.menuOpen = false; $store.user.getAppOpen = true">
|
|
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3v12m-4-4 4 4 4-4M4 16v4h16v-4"/></svg>
|
|
{{ t.player_get_app }}
|
|
</button>
|
|
<a data-online-only href="/admin/" x-show="$store.user.profile?.role === 'admin'" x-cloak>
|
|
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3 4.5 6v5c0 4.5 3.2 8 7.5 10 4.3-2 7.5-5.5 7.5-10V6z"/><path d="m9 12 2 2 4-4"/></svg>
|
|
{{ t.player_admin_panel }}
|
|
</a>
|
|
<a data-online-only href="/logout">
|
|
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M9 4H5v16h4m5-4 4-4-4-4m-5 4h9"/></svg>
|
|
{{ t.player_log_out }}
|
|
</a>
|
|
</div>
|