tvbox支持根据用户细分

This commit is contained in:
mtvpls
2026-02-25 11:56:27 +08:00
parent 6a494f8a1b
commit 0402828c4c
16 changed files with 583 additions and 78 deletions
+21
View File
@@ -482,6 +482,27 @@ export class DbManager {
return [];
}
// ---------- TVBox订阅token ----------
async getTvboxSubscribeToken(userName: string): Promise<string | null> {
if (typeof (this.storage as any).getTvboxSubscribeToken === 'function') {
return (this.storage as any).getTvboxSubscribeToken(userName);
}
return null;
}
async setTvboxSubscribeToken(userName: string, token: string): Promise<void> {
if (typeof (this.storage as any).setTvboxSubscribeToken === 'function') {
await (this.storage as any).setTvboxSubscribeToken(userName, token);
}
}
async getUsernameByTvboxToken(token: string): Promise<string | null> {
if (typeof (this.storage as any).getUsernameByTvboxToken === 'function') {
return (this.storage as any).getUsernameByTvboxToken(token);
}
return null;
}
// ---------- 播放记录迁移 ----------
async migratePlayRecords(userName: string): Promise<void> {
if (typeof (this.storage as any).migratePlayRecords === 'function') {