feat(mpd): add MPD extension#270
Open
psic4t wants to merge 1 commit into
Open
Conversation
Adds a Music Player Daemon extension with three commands: - Show Play Queue: current queue with album covers; jump to or remove songs. - Show Albums: all albums sorted by last added; play or queue an album. - Search Songs: search the library by title, artist, or album. Talks to MPD directly via mpc-js; supports both TCP (MPD_HOST/MPD_PORT) and Unix-socket transports. Album art is fetched via readpicture with an albumart fallback and cached locally under ~/.cache/vicinae-mpd/art. Webradio support in the play queue: - The currently-playing track (from ICY metadata) is shown on top with the station name underneath; ICY title changes are picked up automatically. - Station icons are resolved by priority: embedded stream art (readpicture) first, then the curated WebradioDB image set (by stream URL), then the radio-browser favicon, falling back to a generic stream glyph. Every downloaded image is validated (magic-byte sniffing + minimum size) so broken or HTML-error responses are never cached or displayed. - Stream rows without a Name tag are enriched via radio-browser.info, looked up by stream URL with a name-based fallback. Lookups are cached locally (positive: 7 days, negative: 1 day). The mirror can be pinned with RADIO_BROWSER_API. Validated with `npx vici lint`, `npm test` (235/235), `npm run typecheck`, and `npm run build`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an MPD extension that lets you browse and control a running
Music Player Daemon server from Vicinae.
Commands
Requirements
A running MPD server reachable over TCP (
MPD_HOST/MPD_PORT, defaultslocalhost:6600) or a Unix socket (absolute path inMPD_HOST). No extraCLI tools — the extension talks to MPD directly via the bundled
mpc-jsclient.
Album art is fetched via
readpicturewith analbumartfallback andcached locally under
~/.cache/vicinae-mpd/art.Webradio support
The play queue handles webradio streams as well as local files:
station name underneath; ICY title changes are picked up automatically
while a stream is playing.
embedded stream art (MPD's
readpicture) first, then the curatedWebradioDB image set (by
stream URL), then the radio-browser.info
favicon, falling back to a generic stream glyph. Every downloaded image is
validated (magic-byte sniffing + minimum size) so broken, empty, or
HTML-error responses are never cached or displayed.
Nametag (e.g.added with bare
mpc add http://…) are enriched with the station name andlogo from radio-browser.info, looked up by stream URL with a name-based
fallback. Results are cached locally (positive: 7 days; negative: 1 day).
The mirror can be pinned with
RADIO_BROWSER_API.Privacy
Only your queue's stream URLs and host identities are sent to third parties
(radio-browser, and GitHub Pages for WebradioDB); when an exact URL match
fails, the station
Nametag is also sent to radio-browser's search. Noother MPD data (your library, tags, or listening history) ever leaves your
machine.
Validation
npx vici lint— manifest validnpm test— 235/235 passingnpm run typecheck— cleannpm run build— succeedsNotes
Media.assets/extension_icon.png(512×512).