mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-10 01:15:06 +02:00
Add:Notification settings, notification manager trigger #996
This commit is contained in:
parent
9a7503cde2
commit
ff04eb8d5e
9 changed files with 239 additions and 5 deletions
12
server/Db.js
12
server/Db.js
|
@ -9,8 +9,8 @@ const Library = require('./objects/Library')
|
|||
const Author = require('./objects/entities/Author')
|
||||
const Series = require('./objects/entities/Series')
|
||||
const ServerSettings = require('./objects/settings/ServerSettings')
|
||||
const NotificationSettings = require('./objects/settings/NotificationSettings')
|
||||
const PlaybackSession = require('./objects/PlaybackSession')
|
||||
const Feed = require('./objects/Feed')
|
||||
|
||||
class Db {
|
||||
constructor() {
|
||||
|
@ -43,6 +43,7 @@ class Db {
|
|||
this.series = []
|
||||
|
||||
this.serverSettings = null
|
||||
this.notificationSettings = null
|
||||
|
||||
// Stores previous version only if upgraded
|
||||
this.previousVersion = null
|
||||
|
@ -125,6 +126,10 @@ class Db {
|
|||
this.serverSettings = new ServerSettings()
|
||||
await this.insertEntity('settings', this.serverSettings)
|
||||
}
|
||||
if (!this.notificationSettings) {
|
||||
this.notificationSettings = new NotificationSettings()
|
||||
await this.insertEntity('settings', this.notificationSettings)
|
||||
}
|
||||
global.ServerSettings = this.serverSettings.toJSON()
|
||||
}
|
||||
|
||||
|
@ -166,6 +171,11 @@ class Db {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
var notificationSettings = this.settings.find(s => s.id === 'notification-settings')
|
||||
if (notificationSettings) {
|
||||
this.notificationSettings = new NotificationSettings(notificationSettings)
|
||||
}
|
||||
}
|
||||
})
|
||||
var p5 = this.collectionsDb.select(() => true).then((results) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue