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

This commit is contained in:
advplyr 2021-09-04 19:58:39 -05:00
parent af0365c81f
commit a66a84bd2d
20 changed files with 213 additions and 31 deletions

View file

@ -1,6 +1,7 @@
import Vue from 'vue'
export const state = () => ({
serverSettings: null,
streamAudiobook: null,
showEditModal: false,
selectedAudiobook: null,
@ -21,9 +22,29 @@ export const getters = {
getNumAudiobooksSelected: state => state.selectedAudiobooks.length
}
export const actions = {}
export const actions = {
updateServerSettings({ commit }, payload) {
var updatePayload = {
...payload
}
return this.$axios.$patch('/api/serverSettings', updatePayload).then((result) => {
if (result.success) {
commit('setServerSettings', result.settings)
return true
} else {
return false
}
}).catch((error) => {
console.error('Failed to update server settings', error)
return false
})
}
}
export const mutations = {
setServerSettings(state, settings) {
state.serverSettings = settings
},
setStreamAudiobook(state, audiobook) {
state.playOnLoad = true
state.streamAudiobook = audiobook