mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-04 10:14:36 +02:00
Added support for custom metadata providers
WiP but already open to feedback
This commit is contained in:
parent
8c6a2ac5dd
commit
8027c4a06f
14 changed files with 642 additions and 4 deletions
|
@ -73,6 +73,33 @@ export const state = () => ({
|
|||
|
||||
export const getters = {}
|
||||
|
||||
export const actions = {}
|
||||
export const actions = {
|
||||
reFetchCustom({ dispatch, commit }) {
|
||||
return this.$axios
|
||||
.$get(`/api/custom-metadata-providers`)
|
||||
.then((data) => {
|
||||
const providers = data.providers
|
||||
|
||||
export const mutations = {}
|
||||
commit('setCustomProviders', providers)
|
||||
return data
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Failed', error)
|
||||
return false
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
export const mutations = {
|
||||
setCustomProviders(state, providers) {
|
||||
// clear previous values, and add new values to the end
|
||||
state.providers = state.providers.filter((p) => !p.value.startsWith("custom-"));
|
||||
state.providers = [
|
||||
...state.providers,
|
||||
...providers.map((p) => {return {
|
||||
text: p.name,
|
||||
value: p.slug,
|
||||
}})
|
||||
]
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue