Implement music serving/streaming in shanty-serve #22

Closed
opened 2026-03-17 16:41:03 -04:00 by connor · 0 comments
Owner

The shanty-serve crate serves music files for streaming playback. The initial approach is to implement a Subsonic-compatible API, which would allow users to use existing Subsonic-compatible clients (DSub, Ultrasonic, Sonixd, Sublime Music, etc.) to stream their library.

  1. Subsonic API compatibility — implement the core Subsonic REST API endpoints:

    • ping — server status
    • getLicense — return a valid license (always "valid" for self-hosted)
    • getMusicFolders — return configured library paths
    • getArtists / getArtist — artist listing and details
    • getAlbum — album details with tracks
    • getSong — track details
    • stream — stream the actual audio file (with optional transcoding)
    • download — download the original file
    • getCoverArt — serve album cover art
    • search3 — search the library
    • getPlaylists / getPlaylist — playlist support
    • scrobble — track play history
  2. Transcoding — optionally transcode to a lower bitrate on-the-fly (using ffmpeg) for bandwidth-limited clients. Support common output formats (MP3, OPUS, AAC).

  3. Authentication — the Subsonic API uses a simple username/password scheme. Implement basic auth that works with existing clients.

Design Considerations

  • The Subsonic API is XML-based by default but most clients support JSON. Support both.
  • This could be a separate Actix server on a different port, or additional routes on the main web server.
  • Consider starting with the minimum viable set of Subsonic endpoints that popular clients need to function.

Acceptance Criteria

  • Subsonic-compatible API serves music from the library
  • At least one popular Subsonic client (e.g., Sonixd, DSub) can connect and browse/play
  • Audio streaming works for all supported formats
  • Cover art serving works
  • Basic search works
  • Authentication works
  • Optional transcoding works via ffmpeg

Dependencies

  • Issue #2 (database)
  • Issue #3 (music indexing — library must be populated)
  • External: ffmpeg for transcoding
The `shanty-serve` crate serves music files for streaming playback. The initial approach is to implement a Subsonic-compatible API, which would allow users to use existing Subsonic-compatible clients (DSub, Ultrasonic, Sonixd, Sublime Music, etc.) to stream their library. 1. **Subsonic API compatibility** — implement the core Subsonic REST API endpoints: - `ping` — server status - `getLicense` — return a valid license (always "valid" for self-hosted) - `getMusicFolders` — return configured library paths - `getArtists` / `getArtist` — artist listing and details - `getAlbum` — album details with tracks - `getSong` — track details - `stream` — stream the actual audio file (with optional transcoding) - `download` — download the original file - `getCoverArt` — serve album cover art - `search3` — search the library - `getPlaylists` / `getPlaylist` — playlist support - `scrobble` — track play history 2. **Transcoding** — optionally transcode to a lower bitrate on-the-fly (using ffmpeg) for bandwidth-limited clients. Support common output formats (MP3, OPUS, AAC). 3. **Authentication** — the Subsonic API uses a simple username/password scheme. Implement basic auth that works with existing clients. ### Design Considerations - The Subsonic API is XML-based by default but most clients support JSON. Support both. - This could be a separate Actix server on a different port, or additional routes on the main web server. - Consider starting with the minimum viable set of Subsonic endpoints that popular clients need to function. ### Acceptance Criteria - [ ] Subsonic-compatible API serves music from the library - [ ] At least one popular Subsonic client (e.g., Sonixd, DSub) can connect and browse/play - [ ] Audio streaming works for all supported formats - [ ] Cover art serving works - [ ] Basic search works - [ ] Authentication works - [ ] Optional transcoding works via ffmpeg ### Dependencies - Issue #2 (database) - Issue #3 (music indexing — library must be populated) - External: `ffmpeg` for transcoding
connor added the MediumPriority label 2026-03-19 12:29:39 -04:00
connor started working 2026-03-20 18:40:59 -04:00
connor worked for 1 hour 24 minutes 2026-03-20 20:05:44 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Total Time Spent: 1 hour 24 minutes
connor
1 hour 24 minutes
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Shanty/Main#22