feat(spotify): report resolved backend + binaryAvailable on /status; share backend resolver [S4.2]

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
saopig1andClaude Opus 4.8 committed 2026-07-03 00:45:55 +08:00
1 parent b672d76634
commit 6a72833c2a
6 files changed
+79 -21

No files matched your search

+2 -2
View File
@@ -18,7 +18,7 @@ function makeApp(oauth: SpotifyOAuthLike, role: Role = "admin", caps: string[] =
createSpotifyRouter({
oauth,
logger: pino({ level: "silent" }),
getBackendInfo: () => ({ backend: "librespot", deviceName: "TS-Bot" }),
getBackendInfo: () => ({ backend: "librespot", deviceName: "TS-Bot", binaryAvailable: true }),
webUiRedirect: "/",
}),
);
@@ -84,7 +84,7 @@ describe("spotify OAuth router", () => {
const app = makeApp(fakeOauth({ isAuthorized: () => true }));
const res = await request(app).get("/api/spotify/status");
expect(res.status).toBe(200);
expect(res.body).toEqual({ authorized: true, backend: "librespot", deviceName: "TS-Bot" });
expect(res.body).toEqual({ authorized: true, backend: "librespot", deviceName: "TS-Bot", binaryAvailable: true });
});
it("GET /status is 403 for a guest", async () => {