mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-12 08:29:05 +02:00
Add Subtitle and Narrarator fields, add server settings object, scanner to parse out subtitles
This commit is contained in:
@ -41,6 +41,8 @@ class ApiController {
|
||||
this.router.patch('/user/password', this.userChangePassword.bind(this))
|
||||
this.router.patch('/user/settings', this.userUpdateSettings.bind(this))
|
||||
|
||||
this.router.patch('/serverSettings', this.updateServerSettings.bind(this))
|
||||
|
||||
this.router.post('/authorize', this.authorize.bind(this))
|
||||
|
||||
this.router.get('/genres', this.getGenres.bind(this))
|
||||
@ -308,6 +310,21 @@ class ApiController {
|
||||
})
|
||||
}
|
||||
|
||||
async updateServerSettings(req, res) {
|
||||
var settingsUpdate = req.body
|
||||
if (!settingsUpdate || !isObject(settingsUpdate)) {
|
||||
return res.sendStatus(500)
|
||||
}
|
||||
var madeUpdates = this.db.serverSettings.update(settingsUpdate)
|
||||
if (madeUpdates) {
|
||||
await this.db.updateEntity('settings', this.db.serverSettings)
|
||||
}
|
||||
return res.json({
|
||||
success: true,
|
||||
serverSettings: this.db.serverSettings
|
||||
})
|
||||
}
|
||||
|
||||
async download(req, res) {
|
||||
var downloadId = req.params.id
|
||||
Logger.info('Download Request', downloadId)
|
||||
|
Reference in New Issue
Block a user