mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-19 18:34:25 +02:00
New data model migration for users, bookmarks and playback sessions
This commit is contained in:
parent
4c2ad3ede5
commit
68b13ae45f
17 changed files with 462 additions and 192 deletions
|
@ -108,12 +108,13 @@ class Server {
|
|||
await this.streamManager.removeOrphanStreams()
|
||||
await this.downloadManager.removeOrphanDownloads()
|
||||
|
||||
|
||||
await this.db.init()
|
||||
|
||||
if (version.localeCompare('1.7.3') < 0) {
|
||||
await dbMigration(this.db)
|
||||
if (version.localeCompare('1.7.3') < 0) { // Old version data model migration
|
||||
await dbMigration.migrateUserData(this.db) // Db not yet loaded
|
||||
await this.db.init()
|
||||
await dbMigration.migrateLibraryItems(this.db)
|
||||
// TODO: Eventually remove audiobooks db when stable
|
||||
} else {
|
||||
await this.db.init()
|
||||
}
|
||||
|
||||
this.auth.init()
|
||||
|
@ -125,11 +126,6 @@ class Server {
|
|||
await this.backupManager.init()
|
||||
await this.logManager.init()
|
||||
|
||||
// Only fix duplicate ids once on upgrade
|
||||
if (this.db.previousVersion === '1.0.0') {
|
||||
Logger.info(`[Server] Running scan for duplicate book IDs`)
|
||||
await this.scanner.fixDuplicateIds()
|
||||
}
|
||||
// If server upgrade and last version was 1.7.0 or earlier - add abmetadata files
|
||||
// if (this.db.checkPreviousVersionIsBefore('1.7.1')) {
|
||||
// TODO: wait until stable
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue