mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-15 16:29:37 +00:00
Update:Backups API endpoints, add get all backups route, update socket init event payload
This commit is contained in:
parent
6af5ac2be1
commit
64a8a046c1
7 changed files with 67 additions and 50 deletions
|
|
@ -473,15 +473,14 @@ class Server {
|
|||
await this.db.updateEntity('user', user)
|
||||
|
||||
const initialPayload = {
|
||||
metadataPath: global.MetadataPath,
|
||||
configPath: global.ConfigPath,
|
||||
user: client.user.toJSONForBrowser(),
|
||||
librariesScanning: this.scanner.librariesScanning,
|
||||
backups: (this.backupManager.backups || []).map(b => b.toJSON())
|
||||
userId: client.user.id,
|
||||
username: client.user.username,
|
||||
librariesScanning: this.scanner.librariesScanning
|
||||
}
|
||||
if (user.type === 'root') {
|
||||
if (user.isAdminOrUp) {
|
||||
initialPayload.usersOnline = this.getUsersOnline()
|
||||
}
|
||||
|
||||
client.socket.emit('init', initialPayload)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue