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
@@ -184,6 +184,21 @@ export async function deletePlaylist(p) {
|
||||
await refreshPlaylists();
|
||||
}
|
||||
|
||||
/* ── reorder: a row up, down or to the top; the complete id order goes
|
||||
in one call, as the desktop's drop does ── */
|
||||
export async function moveItem(p, items, item, where) {
|
||||
const ids = items.map((i) => i.id);
|
||||
const from = ids.indexOf(item.id);
|
||||
if (from < 0) return false;
|
||||
const to = where === "top" ? 0 : where === "up" ? from - 1 : from + 1;
|
||||
if (to < 0 || to >= ids.length || to === from) return false;
|
||||
ids.splice(from, 1);
|
||||
ids.splice(to, 0, item.id);
|
||||
await api.playlistSetOrder(p.id, ids);
|
||||
await refreshPlaylists();
|
||||
return true;
|
||||
}
|
||||
|
||||
/* ── removal, undoable ───────────────────────────────────────────────── */
|
||||
let undoTimer = 0;
|
||||
function stashUndo(playlistId, rows, label) {
|
||||
|
||||
Reference in new issue
Block a user