From 4f8eb00c9fc2c27f2e849bebf127f40c43575c01 Mon Sep 17 00:00:00 2001 From: Shane Maynard Date: Sat, 29 Aug 2026 16:41:38 -0400 Subject: [PATCH] feat: progressive music streaming, library-first search, player fixes - Stream downloads as they grow: raw best-audio (no mp3 transcode) served chunked from the stream endpoint mid-download, then with native Range once complete. Songs play within seconds of hitting Play. - Fix searched songs never starting: reconcileMedia now wires the stream URL when a track that was preparing gains one; audio_url is stable for the whole lifecycle so the player never reloads mid-playback. - Progress bars now parse yt-dlp stderr (stdout never carried [download]). - Prefer downloaded songs: /media/api/search merges ready library matches ahead of YouTube results; search_music/play_song tooling and the agent prompt tell Hope to always pick in_library=true. - Mute button turns solid red while the mic is muted. --- AGENTS.md | 77 +++++++++-- agent/agent.py | 11 +- agent/media_mcp.py | 29 +++-- tests/test_media.py | 88 ++++++++++++- web/app.js | 28 ++-- web/media_server.py | 302 ++++++++++++++++++++++++++++++++++---------- web/style.css | 12 +- 7 files changed, 440 insertions(+), 107 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index e857907..4d283f6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -63,10 +63,13 @@ Key variables: ## Media Player Hope can play music on the web UI's media player: YouTube Music search → -yt-dlp download → ffmpeg transcode to mp3 → nginx static streaming (HTTP -Range) back to the browser's `