mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-15 03:45:03 +02:00
Update:Cleanup socket usage & add func for emitting events to admin users
This commit is contained in:
parent
e2af33e136
commit
180293ebc1
7 changed files with 90 additions and 105 deletions
17
server/Db.js
17
server/Db.js
|
@ -258,23 +258,6 @@ class Db {
|
|||
})
|
||||
}
|
||||
|
||||
updateUserStream(userId, streamId) {
|
||||
return this.usersDb.update((record) => record.id === userId, (user) => {
|
||||
user.stream = streamId
|
||||
return user
|
||||
}).then((results) => {
|
||||
Logger.debug(`[DB] Updated user ${results.updated}`)
|
||||
this.users = this.users.map(u => {
|
||||
if (u.id === userId) {
|
||||
u.stream = streamId
|
||||
}
|
||||
return u
|
||||
})
|
||||
}).catch((error) => {
|
||||
Logger.error(`[DB] Update user Failed ${error}`)
|
||||
})
|
||||
}
|
||||
|
||||
updateServerSettings() {
|
||||
global.ServerSettings = this.serverSettings.toJSON()
|
||||
return this.updateEntity('settings', this.serverSettings)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue