feat(api): add GET/PUT /api/me/listenbrainz endpoints

Exposes user ListenBrainz config (token_set bool, enabled, last_scrobbled_at)
via write-only token semantics; enforces no-enable-without-token at the API layer.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-28 09:27:06 -04:00
parent 4d123f1b71
commit 1d1119ac32
6 changed files with 233 additions and 4 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ WHERE id = $1;
SELECT
u.listenbrainz_token,
u.listenbrainz_enabled,
(SELECT MAX(pe.scrobbled_at)
(SELECT MAX(pe.scrobbled_at)::timestamptz
FROM play_events pe
WHERE pe.user_id = u.id) AS last_scrobbled_at
FROM users u