android: reorder from the sheet — a playlist row up, down or to the top; a queue row up or down
Without a drag: a playlist row's sheet moves it up, down or to the top and persists the whole order in one call (playlist_set_order, as the desktop's drop does); a queue row's sheet moves it up or down, never past the track playing. Also src-tauri/android/ship.sh — one round end to end: the mock walk, the embedded build installed, the phone walk, the commit, each step gated on the one before.
This commit is contained in:
1 parent
991d52d0cc
commit
60303c8a95
7 files changed
+127
-7
No files matched your search
@@ -185,6 +185,17 @@ function mockPlaylists(cmd, args) {
|
||||
plTouch(p);
|
||||
return Promise.resolve(rows.map((r) => r.id));
|
||||
}
|
||||
if (cmd === "playlist_set_order") {
|
||||
const p = plOf(args);
|
||||
if (!p) return Promise.reject(new Error("playlist_set_order: no such playlist"));
|
||||
const by = new Map((PL_ITEMS[p.id] || []).map((x) => [x.id, x]));
|
||||
const next = (args?.orderedIds || []).map(Number).map((id) => by.get(id)).filter(Boolean);
|
||||
for (const x of PL_ITEMS[p.id] || []) if (!next.includes(x)) next.push(x);
|
||||
PL_ITEMS[p.id] = next;
|
||||
next.forEach((x, i) => { x.position = i; });
|
||||
plTouch(p);
|
||||
return Promise.resolve();
|
||||
}
|
||||
if (cmd === "playlist_relink_item") {
|
||||
const p = plOf(args);
|
||||
const it = p ? (PL_ITEMS[p.id] || []).find((x) => x.id === Number(args?.itemId)) : null;
|
||||
|
||||
Reference in new issue
Block a user