Implement playlist generation in shanty-playlist #21

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

The shanty-playlist crate generates playlists based on the user's indexed music library. Some of this work has been done in a prior project called "drift" and the approach should be adapted for Shanty's database and architecture.

  1. Playlist generation strategies:

    • Similar artists — given a seed artist, find similar artists (via Last.fm or MusicBrainz) that exist in the library and build a playlist from their top tracks
    • Genre-based — build a playlist from tracks matching a given genre or set of genres
    • Random/shuffle — weighted random selection with configurable rules (e.g., no two tracks by the same artist in a row, prefer recently added, etc.)
    • Smart playlists — rule-based playlists (e.g., "all tracks added in the last 30 days with genre 'rock'")
  2. Output formats:

    • M3U playlist file
    • JSON (for API consumption)
    • Direct integration with the music server (if shanty-serve is available)
  3. CLI interface:

    • shanty-playlist similar <artist> — generate a similar-artists playlist
    • shanty-playlist genre <genre> — generate a genre playlist
    • shanty-playlist random [--count <n>] — random playlist
    • shanty-playlist smart <rules> — rule-based playlist
    • --format <m3u|json> — output format
    • --count <n> — number of tracks (default 50)
  4. Web API integration — expose playlist generation through the web API so the frontend can generate and display playlists

Acceptance Criteria

  • Similar-artist playlist generation works
  • Genre-based playlist generation works
  • Random playlist with rules works
  • M3U output format is valid and plays in standard media players
  • JSON output is well-structured
  • CLI interface works as specified
  • Web API endpoint for generating playlists exists
  • Playlists only include tracks that exist in the local library

Dependencies

  • Issue #2 (database — needs indexed tracks to build playlists from)
  • Issue #3 (music indexing)
  • Issue #14 (MusicBrainz client — for similar artist lookups)
The `shanty-playlist` crate generates playlists based on the user's indexed music library. Some of this work has been done in a prior project called "drift" and the approach should be adapted for Shanty's database and architecture. 1. **Playlist generation strategies:** - **Similar artists** — given a seed artist, find similar artists (via Last.fm or MusicBrainz) that exist in the library and build a playlist from their top tracks - **Genre-based** — build a playlist from tracks matching a given genre or set of genres - **Random/shuffle** — weighted random selection with configurable rules (e.g., no two tracks by the same artist in a row, prefer recently added, etc.) - **Smart playlists** — rule-based playlists (e.g., "all tracks added in the last 30 days with genre 'rock'") 2. **Output formats:** - M3U playlist file - JSON (for API consumption) - Direct integration with the music server (if `shanty-serve` is available) 3. **CLI interface:** - `shanty-playlist similar <artist>` — generate a similar-artists playlist - `shanty-playlist genre <genre>` — generate a genre playlist - `shanty-playlist random [--count <n>]` — random playlist - `shanty-playlist smart <rules>` — rule-based playlist - `--format <m3u|json>` — output format - `--count <n>` — number of tracks (default 50) 4. **Web API integration** — expose playlist generation through the web API so the frontend can generate and display playlists ### Acceptance Criteria - [ ] Similar-artist playlist generation works - [ ] Genre-based playlist generation works - [ ] Random playlist with rules works - [ ] M3U output format is valid and plays in standard media players - [ ] JSON output is well-structured - [ ] CLI interface works as specified - [ ] Web API endpoint for generating playlists exists - [ ] Playlists only include tracks that exist in the local library ### Dependencies - Issue #2 (database — needs indexed tracks to build playlists from) - Issue #3 (music indexing) - Issue #14 (MusicBrainz client — for similar artist lookups)
connor added the MediumPriority label 2026-03-19 12:29:29 -04:00
connor started working 2026-03-20 16:33:27 -04:00
connor worked for 2 hours 3 minutes 2026-03-20 18:37:12 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Total Time Spent: 2 hours 3 minutes
connor
2 hours 3 minutes
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Shanty/Main#21