迁移播放记录到新数据结构,新增自动清理播放记录
This commit is contained in:
@@ -182,6 +182,7 @@ export class DbManager {
|
||||
oidcSub?: string;
|
||||
enabledApis?: string[];
|
||||
created_at: number;
|
||||
playrecord_migrated?: boolean;
|
||||
} | null> {
|
||||
if (typeof (this.storage as any).getUserInfoV2 === 'function') {
|
||||
return (this.storage as any).getUserInfoV2(userName);
|
||||
@@ -259,6 +260,13 @@ export class DbManager {
|
||||
return [];
|
||||
}
|
||||
|
||||
// ---------- 播放记录迁移 ----------
|
||||
async migratePlayRecords(userName: string): Promise<void> {
|
||||
if (typeof (this.storage as any).migratePlayRecords === 'function') {
|
||||
await (this.storage as any).migratePlayRecords(userName);
|
||||
}
|
||||
}
|
||||
|
||||
// ---------- 数据迁移 ----------
|
||||
async migrateUsersFromConfig(adminConfig: AdminConfig): Promise<void> {
|
||||
if (typeof (this.storage as any).createUserV2 !== 'function') {
|
||||
|
||||
Reference in New Issue
Block a user