Skip to content

feat(mpd): add MPD extension#270

Open
psic4t wants to merge 1 commit into
vicinaehq:mainfrom
psic4t:add-mpd-extension
Open

feat(mpd): add MPD extension#270
psic4t wants to merge 1 commit into
vicinaehq:mainfrom
psic4t:add-mpd-extension

Conversation

@psic4t

@psic4t psic4t commented May 12, 2026

Copy link
Copy Markdown

Summary

Adds an MPD extension that lets you browse and control a running
Music Player Daemon server from Vicinae.

Commands

  • Show Play Queue — current queue with album covers; jump to or remove songs.
  • Show Albums — all albums sorted by last added; play or append an album to the queue.
  • Search Songs — search the library by title, artist, or album.

Requirements

A running MPD server reachable over TCP (MPD_HOST / MPD_PORT, defaults
localhost:6600) or a Unix socket (absolute path in MPD_HOST). No extra
CLI tools — the extension talks to MPD directly via the bundled mpc-js
client.

Album art is fetched via readpicture with an albumart fallback and
cached locally under ~/.cache/vicinae-mpd/art.

Webradio support

The play queue handles webradio streams as well as local files:

  • The currently-playing track (from ICY metadata) is shown on top with the
    station name underneath; ICY title changes are picked up automatically
    while a stream is playing.
  • Station icons are resolved from several sources in priority order:
    embedded stream art (MPD's readpicture) first, then the curated
    WebradioDB 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.
  • Station enrichment: stream rows that arrive without a Name tag (e.g.
    added with bare mpc add http://…) are enriched with the station name and
    logo 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 Name tag is also sent to radio-browser's search. No
other MPD data (your library, tags, or listening history) ever leaves your
machine.

Validation

  • npx vici lint — manifest valid
  • npm test — 235/235 passing
  • npm run typecheck — clean
  • npm run build — succeeds

Notes

  • Category: Media.
  • Icon at assets/extension_icon.png (512×512).
  • License: MIT.

@psic4t psic4t force-pushed the add-mpd-extension branch from 59be64a to 70d5f3d Compare June 3, 2026 22:05
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`.
@psic4t psic4t force-pushed the add-mpd-extension branch from 70d5f3d to d67f1c8 Compare June 3, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant