mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-06 07:25:03 +02:00
Add:Email smtp config & send ebooks to devices #1474
This commit is contained in:
parent
15aaf2863c
commit
05ce9c6eda
40 changed files with 1077 additions and 99 deletions
11
server/Db.js
11
server/Db.js
|
@ -12,6 +12,7 @@ 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 EmailSettings = require('./objects/settings/EmailSettings')
|
||||
const PlaybackSession = require('./objects/PlaybackSession')
|
||||
|
||||
class Db {
|
||||
|
@ -49,6 +50,7 @@ class Db {
|
|||
|
||||
this.serverSettings = null
|
||||
this.notificationSettings = null
|
||||
this.emailSettings = null
|
||||
|
||||
// Stores previous version only if upgraded
|
||||
this.previousVersion = null
|
||||
|
@ -156,6 +158,10 @@ class Db {
|
|||
this.notificationSettings = new NotificationSettings()
|
||||
await this.insertEntity('settings', this.notificationSettings)
|
||||
}
|
||||
if (!this.emailSettings) {
|
||||
this.emailSettings = new EmailSettings()
|
||||
await this.insertEntity('settings', this.emailSettings)
|
||||
}
|
||||
global.ServerSettings = this.serverSettings.toJSON()
|
||||
}
|
||||
|
||||
|
@ -202,6 +208,11 @@ class Db {
|
|||
if (notificationSettings) {
|
||||
this.notificationSettings = new NotificationSettings(notificationSettings)
|
||||
}
|
||||
|
||||
const emailSettings = this.settings.find(s => s.id === 'email-settings')
|
||||
if (emailSettings) {
|
||||
this.emailSettings = new EmailSettings(emailSettings)
|
||||
}
|
||||
}
|
||||
})
|
||||
const p5 = this.collectionsDb.select(() => true).then((results) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue