Add discover UI with new song suggestions

Each mix rebuild now also finds songs that aren't in the library: the
user's Listenbrainz recommendations they've never played, plus an LB
Radio prompt per mix when a Listenbrainz token is configured. Each
candidate goes to the mix whose genre profile it fits best and is
skipped if it's already in the library or was played recently.

discover/ is a new React app to listen to the mixes: library songs
stream from Subsonic and suggested songs are found on YouTube with
yt-dlp, both proxied through playlistd with Range support for seeking.
Suggestions can be liked (kept in a "Liked new songs" list) or hidden.

- discover: candidate gathering, genre fit scoring, library filtering
- web: /api/discover routes, Subsonic/YouTube streaming proxy
- youtube: yt-dlp search (skipping hour-long results) and audio URLs
- mix tags now hold library genre names, for display in the UI
- config: listenbrainz.token, discover.ui, discover.ytdlp, discover.format

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018opPJMJjLWr4RqdG6vuK6p
This commit is contained in:
Claude committed 2026-11-13 16:39:46 +00:00
1 parent 18b3f0974e
commit a8b1123777
32 files changed
+4628 -36

No files matched your search

+22 -4
View File
@@ -1,11 +1,14 @@
mod cluster;
mod daemon;
mod discover;
mod listenbrainz;
mod mix;
mod models;
mod playlist;
mod subsonic;
mod track;
mod web;
mod youtube;
use crate::daemon::{cluster_mixes_daemon, create_playlists_daemon, update_playlists_daemon};
use crate::models::{
@@ -71,9 +74,19 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
});
}
rocket::build()
let youtube = youtube::YouTube::new(
CONFIG
.get()
.unwrap()
.get::<String>("discover.ytdlp")
.unwrap_or_else(|_| "yt-dlp".to_string()),
);
let mut server = rocket::build()
.manage(media_client)
.manage(database)
.manage(youtube)
.mount("/api/discover", web::routes())
.mount(
"/api/playlist",
routes![
@@ -84,9 +97,14 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
create_cluster_mix_rule,
all_cluster_mix_rules,
],
)
.launch()
.await?;
);
// the discover UI's built files (discover/dist)
if let Ok(ui) = CONFIG.get().unwrap().get::<String>("discover.ui") {
server = server.mount("/", rocket::fs::FileServer::from(ui));
}
server.launch().await?;
Ok(())
}