Web: Plex playlist editing, offline art, glass search, NO STEMS tag, artist header fix
- Edit/Rename/Delete on Plex playlists, drag-to-reorder edit mode with the iOS remove-then-move-after commit, Remove from playlist, Add to Plex playlists - Downloads store art blobs with each song and group so it shows offline - Search box gets a tinted glass blur - NO STEMS tag restyled and aligned in rows and cards - Albums header on the artist page no longer overlaps the play button Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3ecfdaa73b
commit
0ef4c650d1
4 files changed
+149
-24
No files matched your search
+6
-2
@@ -5,7 +5,7 @@
|
||||
|
||||
import { S, save, songMixes, Offline } from "./store.js";
|
||||
import { Stems, api } from "./stems.js";
|
||||
import { partUrl } from "./plex.js";
|
||||
import { partUrl, img } from "./plex.js";
|
||||
import { emit, load, store, shuffled, toast, clone } from "./util.js";
|
||||
|
||||
// ---- mix -------------------------------------------------------------------------------------
|
||||
@@ -547,8 +547,11 @@ export const Radio = {
|
||||
// ---- offline ----------------------------------------------------------------------------------
|
||||
|
||||
// group: the album or playlist these came from, {title, href}, so Downloads can list them that way.
|
||||
// Art is stored as Blobs with the songs so Downloads shows it with no network.
|
||||
const artBlob = url => url && !url.startsWith("data:") ? fetch(url).then(r => r.ok ? r.blob() : null).catch(() => null) : null;
|
||||
export async function saveOffline(tracks, onStatus, group = null) {
|
||||
let n = 0;
|
||||
if (typeof group?.art === "string") group = { ...group, art: await artBlob(group.art) };
|
||||
for (const t of tracks) {
|
||||
if (Offline.has(t.id)) continue;
|
||||
onStatus?.(`Downloading ${++n} of ${tracks.length}: ${t.title}`);
|
||||
@@ -566,7 +569,8 @@ export async function saveOffline(tracks, onStatus, group = null) {
|
||||
blobs = { file: await r.blob() };
|
||||
}
|
||||
const size = Object.values(blobs).reduce((a, b) => a + b.size, 0);
|
||||
await Offline.put({ id: t.id, track: t, entry, fmt: entry ? S.fmt : "original", size, peaks: peaks?.stems || null, blobs, group, saved: Date.now() });
|
||||
const art = await artBlob(t.srv && t.thumb ? img(t.srv, t.thumb, 300) : "");
|
||||
await Offline.put({ id: t.id, track: t, entry, art, fmt: entry ? S.fmt : "original", size, peaks: peaks?.stems || null, blobs, group, saved: Date.now() });
|
||||
} catch (e) { toast(`Couldn't download “${t.title}”: ${e.message}`); }
|
||||
}
|
||||
emit("offline");
|
||||
|
||||
Reference in new issue
Block a user