Add BooksSyncContext, refine database schema, and enhance synchronization support
- Introduce `BooksSyncContext` for managing book synchronization states (server-only, local-only, to-sync, etc.). - Remove `UserContext` and related dependencies. - Refine localization strings (`en.json`) with sync-related updates (e.g., "toSyncFromServer", "toSyncToServer"). - Extend database schema with additional tables and fields for syncing books, chapters, and related entities. - Add `last_update` fields and update corresponding repository methods to support synchronization logic. - Enhance IPC handlers with stricter typing, data validation, and sync-aware operations.
This commit is contained in:
@@ -27,10 +27,9 @@ export class DatabaseService {
|
||||
if (this.db) {
|
||||
this.close();
|
||||
}
|
||||
|
||||
// Get user data directory
|
||||
const userDataPath = app.getPath('userData');
|
||||
const dbPath = path.join(userDataPath, `eritors-local-${userId}.db`);
|
||||
|
||||
const userDataPath:string = app.getPath('userData');
|
||||
const dbPath:string = path.join(userDataPath, `eritors-local.db`);
|
||||
|
||||
this.db = new sqlite3.Database(dbPath);
|
||||
this.userEncryptionKey = encryptionKey;
|
||||
|
||||
Reference in New Issue
Block a user