From 65ac7efef49d1ef32071cd82e36017d226f76790 Mon Sep 17 00:00:00 2001 From: Twarner491 Date: Thu, 28 May 2026 12:03:18 -0700 Subject: [PATCH] Fix atlas-card click + wire live audio + verify pipeline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add hidden admin-screen stub to index.html. The live JS calls adminEl.setAttribute() on every hashchange (via openAdmin/closeAdmin); with the element missing those threw a null-ref that killed syncRouter mid-flight, so atlas card clicks set the hash but never opened the detail modal. Stub is empty - menu items navigate to BirdNET-Pi's stock pages instead of triggering in-app admin. - Point the live-audio Audio() at /stream (BirdNET-Pi's existing icecast reverse-proxy from install_services.sh:189) instead of the worker's /birdnet/stream. The drawer's live-audio button now plays real BirdNET-Pi audio on local installs. Verified end-to-end in Docker container: - Landing collage: 4 tiles render from seeded DB - Atlas click: detail modal opens with image + sci/common name - Menu drawer: opens, shows 4 items (no password in local mode) - Auto-refresh: INSERTed Bubo virginianus into birds.db, forced refresh via window picker re-click, tile count 4→5 with the new species appearing in the collage. --- avian/frontend/apt.js | 2 +- avian/frontend/index.html | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/avian/frontend/apt.js b/avian/frontend/apt.js index 2723aa3..1387e75 100644 --- a/avian/frontend/apt.js +++ b/avian/frontend/apt.js @@ -1322,7 +1322,7 @@ // race a timeout because icecast can take 1–10s to warm up // depending on tunnel + bitrate. return new Promise(function (resolve, reject) { - liveEl = new Audio('?t=' + Date.now()); + liveEl = new Audio('/stream?t=' + Date.now()); // No crossOrigin — the stream is same-origin via the worker // and crossOrigin='anonymous' would require CORS headers // icecast doesn't send. diff --git a/avian/frontend/index.html b/avian/frontend/index.html index f9015b6..9107030 100644 --- a/avian/frontend/index.html +++ b/avian/frontend/index.html @@ -187,6 +187,18 @@ + + + +