v0.17.0: the desktop already knows what the songs are

The first half of andTunes, a music player for the Rabbit R1. Auxio re-reads
Android's MediaStore on every launch, which is the "your songs will show up
here" hang — so the answer isn't a faster scanner, it's not scanning at all.
LinTunes already knows the artist, album and year of every file it just
copied, so it writes them into Music/andTunes/library.json and the app reads
one file instead of indexing a filesystem.

New lintunes/andtunes/: layout.py (a de-duplicated Media/<Artist>/<Album>/
tree, so a song in three playlists is stored once), manifest.py (pure, Qt-free),
art.py (one 480 px cover per album via QImage, cached and invalidated by the
audio file's mtime — which is exactly what embedding new art moves), and
sync.py, a third sibling of plan_export/ExportWorker.

Three rules the code depends on: planning never renders art (a mutagen open
per album, and planning runs on the GUI thread); the index is written last and
after a cancel lists only tracks whose files actually landed; and every delete
goes through layout.assert_inside, which is why the old Music/<Playlist>/
folders are structurally unreachable rather than merely un-referenced.

Connections gains "Sync to Rabbit" and "Rabbit Sync Settings…" — the ticked
set is the device's contents, so unticking is how a playlist comes off, which
nothing could do before. The selection rides preferences.json so both machines
agree. The old per-playlist sync stays, renamed "(Auxio)": removing it now
would leave the device full of files and nothing able to open them until the
app exists.

The app itself is rounds 48-50; its board is andtunes/TASKS.md, including the
measured screen facts (480x640 px at density override 160 — one dp is half its
usual physical size on a 2.88" panel).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015wrTys5U1fLb4pBD2LKWzV
This commit is contained in:
2026-09-06 03:25:40 -04:00
co-authored by Claude Opus 5
parent 4acc57b648
commit cc1ca5ef78
15 changed files with 1780 additions and 11 deletions
+28
View File
@@ -9,6 +9,34 @@ When a round closes, move its finished items to `tasks-done.md`.
- [ ] archive the done tasks in here to another file, this is crufty....
## Round 47 (2026-09-06) — LinTunes writes the device's library: done, see tasks-done.md
The desktop half of andTunes: a de-duplicated `Music/andTunes/` tree, a
`library.json` the R1 app reads instead of scanning, per-album cover export,
and a ticked-playlist selection that makes unticking the way to remove one.
The app itself is rounds 48–50 — its board is `andtunes/TASKS.md`. Left on
the table:
- [ ] **Ship default button images.** The spec wants the six menu tiles to be
replaceable artwork "stored in an easy spot". The device side is
designed (`Buttons/<name>.png`, app falls back to a bundled drawable)
but LinTunes doesn't write the defaults yet — and when it does it must
only fill in files that are *missing*, never overwrite trav's own.
- [ ] **A format gate for what Android can't decode.** Sync copies every
suffix verbatim today. AIFF and protected AAC will simply fail to play
on the device. Wants the `export/web_support.py` shape: deny-by-default
on the suffix with the iTunes `kind` breaking the `.m4a` tie, and
FLAC-only conversion so it can never cost a bit.
- [ ] **Clean up the old `Music/<Playlist>/` folders.** They're outside the
andTunes root and the containment guard makes them unreachable on
purpose, so this has to be a separate, explicitly confirmed action —
and only once andTunes has replaced Auxio.
- [ ] **Art export is the slow part of a sync.** One mutagen open + JPEG
encode per album, on the worker thread, uncounted in the progress
bar's byte total (the bar sits full while the label says "Album art").
Fine for a few hundred albums; if trav syncs a thousand it wants a
second progress phase with its own range.
## Round 46 (2026-09-02) — The file already told you: done, see tasks-done.md
Filename-derived proposals when no database knows the song, plus using the