feat(spotify): Web API client + catalog mappers, add spotify platform

Adds src/music/spotify/webapi.ts (client-credentials token, catalog
mappers, 429 retry) + tests, and threads the new "spotify" platform id
through the type unions in provider.ts and database.ts. Also widens the
downstream QueuedSong.platform union (audio/queue.ts) and the
getProviderFor parameter (bot/instance.ts) so tsc --noEmit stays clean;
these two are the necessary call-site fixes for the new union member.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
saopig1andClaude Opus 4.8 committed 2026-07-01 23:52:22 +08:00
1 parent b352d71528
commit 6c16e2d966
6 files changed
+316 -7

No files matched your search

+1 -1
View File
@@ -10,7 +10,7 @@ export interface QueuedSong {
name: string;
artist: string;
album: string;
platform: "netease" | "qq" | "bilibili" | "youtube" | "local" | "kugou";
platform: "netease" | "qq" | "bilibili" | "youtube" | "local" | "kugou" | "spotify";
url?: string; // resolved lazily at play time
coverUrl: string;
duration: number; // seconds