Add Subtitle and Narrarator fields, add server settings object, scanner to parse out subtitles

This commit is contained in:
Mark Cooper 2021-09-04 19:58:39 -05:00
parent e566c6c9d5
commit af05e78cdf
20 changed files with 213 additions and 31 deletions

View file

@ -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)