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:
natreex
2026-01-26 19:57:56 -05:00
parent 2359638cb0
commit cec5830360
35 changed files with 5483 additions and 203 deletions

View File

@@ -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;