Scrobble plays from the UI, and vary suggestions between rebuilds

Scrobbling: the UI reports "now playing" when a song starts, and a listen
once half of it (or 4 minutes) has actually been played. Library songs go
through Subsonic's scrobble endpoint, which keeps play counts and passes
them on to the user's Listenbrainz/Last.fm; YouTube songs go straight to
Listenbrainz with listenbrainz.token. discover.scrobble = false turns it
off. Also stops the previous YouTube video when moving to the next YouTube
song, as it played on while the next was looked up.

Fresher suggestions: each mix's suggestions are a random sample of its
best 3 x discovery_count candidates, weighted by fit squared, rather than
always the top ones. Suggestions left alone for a week expire, and stay
out of the mixes for 60 days.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jude SouthworthandClaude Opus 5.5 committed 2026-11-24 08:22:57 +00:00
1 parent 39cd2b69f1
commit b75f66c205
18 files changed
+437 -15

No files matched your search

@@ -0,0 +1,15 @@
{
"db_name": "PostgreSQL",
"query": "\n DELETE FROM \"mix_suggestion\"\n WHERE rule_id = $1 AND status = 'expired' AND expired_at < NOW() - make_interval(days => $2)\n ",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Uuid",
"Int4"
]
},
"nullable": []
},
"hash": "31bb71a0aa408eef106d263020d928b91514677637f585cdc53344b86c138f7a"
}
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
"query": "\n SELECT * FROM \"mix_suggestion\"\n WHERE mix_id = $1 AND status <> 'dismissed'\n ORDER BY score DESC\n ",
"query": "\n SELECT * FROM \"mix_suggestion\"\n WHERE mix_id = $1 AND status IN ('new', 'liked')\n ORDER BY score DESC\n ",
"describe": {
"columns": [
{
@@ -62,6 +62,11 @@
"ordinal": 11,
"name": "created_at",
"type_info": "Timestamptz"
},
{
"ordinal": 12,
"name": "expired_at",
"type_info": "Timestamptz"
}
],
"parameters": {
@@ -81,8 +86,9 @@
false,
false,
true,
false
false,
true
]
},
"hash": "8b606b7e728f8e0d6505a7246f785dab6370f62fd442ede54a5e79c075bae8b7"
"hash": "8cdf21728821fa2672912ea9c151f7138c09e3ef76ec38465c94a389adcf2c5c"
}
@@ -0,0 +1,15 @@
{
"db_name": "PostgreSQL",
"query": "\n UPDATE \"mix_suggestion\" SET status = 'expired', expired_at = NOW()\n WHERE rule_id = $1 AND status = 'new' AND created_at < NOW() - make_interval(days => $2)\n ",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Uuid",
"Int4"
]
},
"nullable": []
},
"hash": "ca7e7a1692e7a2510b792bede575f218f62438ee3d47728caac0dc07841fd49d"
}
@@ -62,6 +62,11 @@
"ordinal": 11,
"name": "created_at",
"type_info": "Timestamptz"
},
{
"ordinal": 12,
"name": "expired_at",
"type_info": "Timestamptz"
}
],
"parameters": {
@@ -81,7 +86,8 @@
false,
false,
true,
false
false,
true
]
},
"hash": "d46de753581651896a2b6e9385d3821d22c323ca30f73f37ca845e95472fcc76"
@@ -62,6 +62,11 @@
"ordinal": 11,
"name": "created_at",
"type_info": "Timestamptz"
},
{
"ordinal": 12,
"name": "expired_at",
"type_info": "Timestamptz"
}
],
"parameters": {
@@ -81,7 +86,8 @@
false,
false,
true,
false
false,
true
]
},
"hash": "d56f95b38163d21d48148082557bbe4afc99732fbf2eb73ac1fee91c761387e9"
@@ -62,6 +62,11 @@
"ordinal": 11,
"name": "created_at",
"type_info": "Timestamptz"
},
{
"ordinal": 12,
"name": "expired_at",
"type_info": "Timestamptz"
}
],
"parameters": {
@@ -82,7 +87,8 @@
false,
false,
true,
false
false,
true
]
},
"hash": "e5b622cf8653fb19c5c1728c31af759a9acbc46adcbdacaff93800552ac5426b"