From 89cd6aa1dd34ae4660d372e5860af3416638703b Mon Sep 17 00:00:00 2001 From: BenStullsBets Date: Thu, 2 Jul 2026 18:02:22 -0700 Subject: [PATCH] fix(build): include the Music playlist in the static media sync MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Music-option tracks are referenced by app.js (MUSIC_PLAYLIST), not the manifest/ring, so build_static skipped them — Music would 404 on the static site. Add audio/music/.mp3 explicitly. +1 pytest. Co-Authored-By: Claude Opus 4.8 --- tests/test_build_static.py | 10 ++++++++++ tools/build_static.py | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/tests/test_build_static.py b/tests/test_build_static.py index 9f354a3..84c79ac 100644 --- a/tests/test_build_static.py +++ b/tests/test_build_static.py @@ -53,3 +53,13 @@ def test_build_emits_frontend_baked_json_and_only_referenced_media(tmp_path): for f in versions["versions"]: assert (media / f).exists(), f"missing synced media: {f}" assert result["media_files"] == sum(1 for _ in media.rglob("*") if _.is_file()) + + +def test_build_includes_the_music_playlist(tmp_path): + # The Music-option tracks are referenced by app.js (MUSIC_PLAYLIST), not the + # manifest — the build must copy them explicitly or Music 404s on the static site. + out = tmp_path / "dist" + media = tmp_path / "media" + build_static(out, media, media_base="https://static.benstull.art/", app_path="/human-machine-strata") + for name in ("manatees", "dewdrop", "eastminster", "overheat", "concentration"): + assert (media / "audio" / "music" / f"{name}.mp3").exists(), f"music track not synced: {name}" diff --git a/tools/build_static.py b/tools/build_static.py index 3a4db51..ace7e58 100644 --- a/tools/build_static.py +++ b/tools/build_static.py @@ -151,6 +151,10 @@ def build_static(out_dir, media_out, *, media_base: str, app_path: str) -> dict: for s in ring.get("scales", []): if s.get("audio"): referenced.add(f"audio/{s['audio']}") + # The Music-option playlist is referenced by the client (app.js MUSIC_PLAYLIST), + # not the manifest/ring — add it explicitly or Music 404s on the static site. + for name in ("manatees", "dewdrop", "eastminster", "overheat", "concentration"): + referenced.add(f"audio/music/{name}.mp3") n = 0 for rel in sorted(referenced): src = MEDIA_DIR / rel