mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-10-02 04:52:50 +08:00
feat: expose vip flag on Song for trial-only detection
Add optional vip?: boolean to the Song interface so downstream clients (e.g. PowerfulTS) can mark copyright-restricted songs that non-VIP users can only play as a trial fragment, before playback starts. - provider.ts: add optional vip?: boolean (backward compatible) - netease.ts: extract mapNeteaseSongs() pure fn; map fee to vip (1=VIP, 4=album-only). fee=8 (free low-quality) is excluded because it plays in full, just at lower quality. - qq.ts: mapQqSongs() maps pay.payplay/paytrackprice to vip (one fix covers all callers); getDailyRecommendSongs inline mapping too. - tests: vip mapping assertions for netease fee (1/4=vip, 0/8=free) and qq pay fields.
This commit is contained in:
1 parent
06aaec4ba5
commit
7b2bd0ea6a
5 files changed
+62
-59
No files matched your search
@@ -6,6 +6,9 @@ export interface Song {
|
||||
duration: number; // seconds
|
||||
coverUrl: string;
|
||||
platform: "netease" | "qq" | "bilibili" | "youtube";
|
||||
/** VIP / copyright-restricted: non-VIP users can only play a trial fragment
|
||||
* (NetEase fee=1 VIP / fee=4 album-only, or QQ pay.payplay/paytrackprice=1). */
|
||||
vip?: boolean;
|
||||
}
|
||||
|
||||
export interface SongWithUrl extends Song {
|
||||
|
||||
Reference in new issue
Block a user