增加漫画展馆功能

This commit is contained in:
mtvpls
2026-04-16 16:01:47 +08:00
parent 4fe9314c57
commit cb225c3291
33 changed files with 3242 additions and 5 deletions
+35
View File
@@ -3,6 +3,7 @@
import { AdminConfig } from './admin.types';
import { MusicPlayRecord } from './db.client';
import { KvrocksStorage } from './kvrocks.db';
import { MangaReadRecord, MangaShelfItem } from './manga.types';
import { MusicV2HistoryRecord, MusicV2PlaylistItem, MusicV2PlaylistRecord } from './music-v2';
import { RedisStorage } from './redis.db';
import { DanmakuFilterConfig,Favorite, IStorage, PlayRecord, SkipConfig } from './types';
@@ -726,6 +727,40 @@ export class DbManager {
await this.storage.deleteSearchHistory(userName, keyword);
}
// ---------- 漫画书架 ----------
async getMangaShelf(userName: string, sourceId: string, mangaId: string): Promise<MangaShelfItem | null> {
return this.storage.getMangaShelf(userName, generateStorageKey(sourceId, mangaId));
}
async saveMangaShelf(userName: string, sourceId: string, mangaId: string, item: MangaShelfItem): Promise<void> {
await this.storage.setMangaShelf(userName, generateStorageKey(sourceId, mangaId), item);
}
async getAllMangaShelf(userName: string): Promise<{ [key: string]: MangaShelfItem }> {
return this.storage.getAllMangaShelf(userName);
}
async deleteMangaShelf(userName: string, sourceId: string, mangaId: string): Promise<void> {
await this.storage.deleteMangaShelf(userName, generateStorageKey(sourceId, mangaId));
}
// ---------- 漫画阅读历史 ----------
async getMangaReadRecord(userName: string, sourceId: string, mangaId: string): Promise<MangaReadRecord | null> {
return this.storage.getMangaReadRecord(userName, generateStorageKey(sourceId, mangaId));
}
async saveMangaReadRecord(userName: string, sourceId: string, mangaId: string, record: MangaReadRecord): Promise<void> {
await this.storage.setMangaReadRecord(userName, generateStorageKey(sourceId, mangaId), record);
}
async getAllMangaReadRecords(userName: string): Promise<{ [key: string]: MangaReadRecord }> {
return this.storage.getAllMangaReadRecords(userName);
}
async deleteMangaReadRecord(userName: string, sourceId: string, mangaId: string): Promise<void> {
await this.storage.deleteMangaReadRecord(userName, generateStorageKey(sourceId, mangaId));
}
// 获取全部用户名
async getAllUsers(): Promise<string[]> {
if (typeof (this.storage as any).getAllUsers === 'function') {