mirror of
https://github.com/lifegpc/bookdownload.git
synced 2026-07-08 01:31:31 +08:00
Add support to load chapter lists from databases
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { DbConfig, DbType } from "../config";
|
||||
import { IndexedDb } from "./indexedDb";
|
||||
import { PocketBaseDb } from "./pocketBase";
|
||||
import type { QdChapterInfo, QdBookInfo, PagedData } from "../types";
|
||||
import type { QdChapterInfo, QdBookInfo, PagedData, QdChapterSimpleInfo } from "../types";
|
||||
|
||||
export interface Db {
|
||||
init(): Promise<void>;
|
||||
@@ -17,6 +17,12 @@ export interface Db {
|
||||
saveQdBook(info: QdBookInfo): Promise<void>;
|
||||
getQdBook(id: number): Promise<QdBookInfo | undefined>;
|
||||
getQdBooks(page: number, pageSize: number): Promise<PagedData<QdBookInfo>>;
|
||||
/**
|
||||
* Retrieve chapter list of a book. if bookId is not found, return empty array.
|
||||
* Primary key should be the latest (time is biggest) saved chapter.
|
||||
* @param bookId Book ID
|
||||
*/
|
||||
getChapterSimpleInfos(bookId: number): Promise<QdChapterSimpleInfo[]>;
|
||||
close(): void;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user