mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-25 05:09:40 +00:00
Add Subtitle and Narrarator fields, add server settings object, scanner to parse out subtitles
This commit is contained in:
parent
e566c6c9d5
commit
af05e78cdf
20 changed files with 213 additions and 31 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ export const actions = {
|
|||
return this.$axios.$patch('/api/user/settings', updatePayload).then((result) => {
|
||||
if (result.success) {
|
||||
commit('setSettings', result.settings)
|
||||
console.log('Settings updated', result.settings)
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue