mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-19 10:19:37 +00:00
Backups to store server version in zip details and check and show alert for old backups created before version 2.0.0
This commit is contained in:
parent
79a82df914
commit
05dff2583a
3 changed files with 29 additions and 8 deletions
|
|
@ -92,6 +92,12 @@ class BackupManager {
|
|||
var details = data.toString('utf8').split('\n')
|
||||
|
||||
var backup = new Backup({ details, fullPath: tempPath })
|
||||
|
||||
if (!backup.serverVersion) {
|
||||
Logger.error(`[BackupManager] Invalid backup with no server version - might be a backup created before version 2.0.0`)
|
||||
return res.status(500).send('Invalid backup. Might be a backup created before version 2.0.0.')
|
||||
}
|
||||
|
||||
backup.fileSize = await getFileSize(backup.fullPath)
|
||||
|
||||
var existingBackupIndex = this.backups.findIndex(b => b.id === backup.id)
|
||||
|
|
@ -133,6 +139,11 @@ class BackupManager {
|
|||
var details = data.toString('utf8').split('\n')
|
||||
|
||||
var backup = new Backup({ details, fullPath: fullFilePath })
|
||||
|
||||
if (!backup.serverVersion) {
|
||||
Logger.error(`[BackupManager] Old unsupported backup was found "${backup.fullPath}"`)
|
||||
}
|
||||
|
||||
backup.fileSize = await getFileSize(backup.fullPath)
|
||||
var existingBackupWithId = this.backups.find(b => b.id === backup.id)
|
||||
if (existingBackupWithId) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue