Create and delete genre mixes from the web UI

- Add a form to create a cluster mix rule: shown on first visit when there
  are no rules, and from a + in the sidebar for another Listenbrainz user.
  Backed by POST /api/discover/rules, which validates each setting and
  allows one rule per Listenbrainz user.
- Add deleting a user's mixes from a bin in the sidebar, optionally also
  deleting the mixes' playlists from Subsonic. Backed by
  DELETE /api/discover/rules/<id>?delete_playlists=true.
- Stop showing the previous user's mix while a new user's mixes build.
- Remove the per-account Listenbrainz token: LB Radio now always uses
  listenbrainz.token from the config. A migration drops the token columns
  from app_user, and PUT /api/auth/account/listenbrainz is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
judeandClaude Opus 5.5 committed 2026-11-22 09:45:52 +00:00
1 parent f5cb5076ca
commit 93e12cfc72
23 files changed
+701 -344

No files matched your search

@@ -1,16 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "UPDATE \"app_user\" SET listenbrainz_token = $1, listenbrainz_user = $2 WHERE id = $3",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Text",
"Varchar",
"Uuid"
]
},
"nullable": []
},
"hash": "1664ef4607bff9355a30d553780de39ef9883b134c4f1ad97d55ad7c9bead982"
}
@@ -0,0 +1,22 @@
{
"db_name": "PostgreSQL",
"query": "SELECT playlist_id FROM \"cluster_mix_playlist\" WHERE rule_id = $1",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "playlist_id",
"type_info": "Varchar"
}
],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": [
false
]
},
"hash": "28192c8717a3cb6654c3868c43f2fbe2c542e7c81ddf28f91b60d112a7a9e95b"
}
@@ -0,0 +1,22 @@
{
"db_name": "PostgreSQL",
"query": "SELECT username FROM \"app_user\" WHERE id = $1",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "username",
"type_info": "Varchar"
}
],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": [
false
]
},
"hash": "5b3c5bc84a46ee28e84803d183820cc6e52f5c7492dbd3aeb6bbf90a7795cca9"
}
@@ -1,20 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "\n SELECT listenbrainz_token AS \"token!\" FROM \"app_user\"\n WHERE listenbrainz_token IS NOT NULL\n ORDER BY created_at\n LIMIT 1\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "token!",
"type_info": "Text"
}
],
"parameters": {
"Left": []
},
"nullable": [
true
]
},
"hash": "a4d51df9526259bd7f3341afe8319b8a225ef01ac92825065860cb868b04cbd9"
}
@@ -1,34 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "\n SELECT username, listenbrainz_user, listenbrainz_token IS NOT NULL AS \"has_listenbrainz_token!\"\n FROM \"app_user\" WHERE id = $1\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "username",
"type_info": "Varchar"
},
{
"ordinal": 1,
"name": "listenbrainz_user",
"type_info": "Varchar"
},
{
"ordinal": 2,
"name": "has_listenbrainz_token!",
"type_info": "Bool"
}
],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": [
false,
true,
null
]
},
"hash": "a8a3265d8f0f08b56916fe819a3834d0a41c153ceba338b00ff52f3e1ae39fe4"
}
@@ -0,0 +1,22 @@
{
"db_name": "PostgreSQL",
"query": "DELETE FROM \"cluster_mix_rule\" WHERE id = $1 RETURNING tracking_user",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "tracking_user",
"type_info": "Varchar"
}
],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": [
false
]
},
"hash": "b1284c3dd34ac0f15791efd36f985d85a36795f49980e1fac023e12c610e4fef"
}