v0.18.0: paste a link, get the song

File > Import from URL... runs trav's `song` helper (yt-dlp --extract-audio
--audio-format mp3) from inside the app. Everything at the link downloads to
a private temp dir and is imported as each song lands. "and add to current
playlist?" puts the batch above the selected song, else at the end of the
playing playlist, else at the end of the shown one, in the link's order.
Each song goes straight into Identify Track. With no AcoustID key, the
proposal comes from the filename alone.

Album art now opens on a single click, in a window shaped like the cover
and as big as the screen allows.

Also fixed the dev fixture's play journal, which crashed startup (wrong
shape) and would have been ignored anyway (wrong keys). The loader now
skips a journal it can't read instead of aborting.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R5m9mXFPHNro78BdD69mG2
This commit is contained in:
2026-09-10 23:44:45 -05:00
co-authored by Claude Opus 5
parent bcba621f3f
commit 8188a5b389
13 changed files with 1179 additions and 33 deletions
+6 -4
View File
@@ -330,12 +330,14 @@ def _write_plays(data_dir: Path, ids: list):
"""One machine's play journal, in the per-machine-totals shape."""
plays = data_dir / "plays"
plays.mkdir(parents=True, exist_ok=True)
entries = {str(tid): {"play_count": random.randint(1, 12),
"play_date_utc": _iso(random.randint(0, 200))}
entries = {str(tid): {"plays": random.randint(1, 12),
"last_played": _iso(random.randint(0, 200))}
for tid in random.sample(ids, k=min(8, len(ids)))}
# The same flat {track id: totals} map PlayJournal.save() writes, with
# record_play()'s keys. The machine is the filename; there is no wrapper
# object.
(plays / "devbox.json").write_text(
json.dumps({"machine": "devbox", "tracks": entries}, indent=2),
encoding="utf-8")
json.dumps(entries, indent=2), encoding="utf-8")
def _write_prefs(data_dir: Path, library: Library):