Introduce series management functionality and repository updates
- Added `series-world.repo.ts` to handle database operations related to series worlds and their elements. - Implemented `series-sync.repo.ts` for managing synchronization between books and series. - Expanded `spell.ipc.ts` data models to include `seriesSpellId` for spell synchronization. - Refactored `insertSpellTag` method in `spelltag.repo.ts` for improved error handling and logic clarity.
This commit is contained in:
@@ -58,6 +58,10 @@ export interface BookToolsTable extends Record<string, SQLiteValue> {
|
||||
|
||||
export interface SyncedBookToolsResult extends Record<string, SQLiteValue> {
|
||||
last_update: number;
|
||||
characters_enabled: number;
|
||||
worlds_enabled: number;
|
||||
locations_enabled: number;
|
||||
spells_enabled: number;
|
||||
}
|
||||
|
||||
export default class BookRepo {
|
||||
@@ -440,7 +444,7 @@ export default class BookRepo {
|
||||
static fetchSyncedBookTools(userId: string, bookId: string, lang: 'fr' | 'en'): SyncedBookToolsResult | null {
|
||||
try {
|
||||
const db: Database = System.getDb();
|
||||
const query: string = 'SELECT last_update FROM book_tools WHERE user_id = ? AND book_id = ?';
|
||||
const query: string = 'SELECT last_update, characters_enabled, worlds_enabled, locations_enabled, spells_enabled FROM book_tools WHERE user_id = ? AND book_id = ?';
|
||||
const params: SQLiteValue[] = [userId, bookId];
|
||||
const result = db.get(query, params) as SyncedBookToolsResult | undefined;
|
||||
return result ?? null;
|
||||
|
||||
Reference in New Issue
Block a user