mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-03 01:35:08 +02:00
Merge pull request #2133 from mfcar/mf/backup
Add more information to the backup page
This commit is contained in:
commit
102c90c4e8
17 changed files with 40 additions and 8 deletions
|
@ -6,7 +6,8 @@ class BackupController {
|
|||
|
||||
getAll(req, res) {
|
||||
res.json({
|
||||
backups: this.backupManager.backups.map(b => b.toJSON())
|
||||
backups: this.backupManager.backups.map(b => b.toJSON()),
|
||||
backupLocation: this.backupManager.backupLocation
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -42,6 +43,9 @@ class BackupController {
|
|||
Logger.debug(`Use X-Accel to serve static file ${encodedURI}`)
|
||||
return res.status(204).header({ 'X-Accel-Redirect': encodedURI }).send()
|
||||
}
|
||||
|
||||
res.setHeader('Content-disposition', 'attachment; filename=' + req.backup.filename)
|
||||
|
||||
res.sendFile(req.backup.fullPath)
|
||||
}
|
||||
|
||||
|
@ -65,4 +69,4 @@ class BackupController {
|
|||
next()
|
||||
}
|
||||
}
|
||||
module.exports = new BackupController()
|
||||
module.exports = new BackupController()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue