2021-10-05 05:11:42 +02:00
|
|
|
export const state = () => ({
|
2022-01-09 00:03:33 +01:00
|
|
|
providers: [
|
|
|
|
{
|
|
|
|
text: 'Google Books',
|
|
|
|
value: 'google'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: 'Open Library',
|
|
|
|
value: 'openlibrary'
|
|
|
|
},
|
|
|
|
{
|
2022-10-08 00:18:28 +02:00
|
|
|
text: 'iTunes',
|
|
|
|
value: 'itunes'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: 'Audible.com',
|
2022-01-09 00:03:33 +01:00
|
|
|
value: 'audible'
|
2022-03-07 00:26:35 +01:00
|
|
|
},
|
|
|
|
{
|
2022-10-08 00:18:28 +02:00
|
|
|
text: 'Audible.ca',
|
|
|
|
value: 'audible.ca'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: 'Audible.co.uk',
|
|
|
|
value: 'audible.uk'
|
|
|
|
},
|
|
|
|
{
|
2022-11-21 00:17:25 +01:00
|
|
|
text: 'Audible.com.au',
|
2022-10-08 00:18:28 +02:00
|
|
|
value: 'audible.au'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: 'Audible.fr',
|
|
|
|
value: 'audible.fr'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: 'Audible.de',
|
|
|
|
value: 'audible.de'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: 'Audible.co.jp',
|
|
|
|
value: 'audible.jp'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: 'Audible.it',
|
|
|
|
value: 'audible.it'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: 'Audible.co.in',
|
|
|
|
value: 'audible.in'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: 'Audible.es',
|
|
|
|
value: 'audible.es'
|
2023-02-06 22:25:18 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
text: 'FantLab.ru',
|
|
|
|
value: 'fantlab'
|
2022-01-09 00:03:33 +01:00
|
|
|
}
|
2022-03-18 23:09:17 +01:00
|
|
|
],
|
|
|
|
podcastProviders: [
|
|
|
|
{
|
|
|
|
text: 'iTunes',
|
|
|
|
value: 'itunes'
|
|
|
|
}
|
2023-04-20 07:13:52 +02:00
|
|
|
],
|
|
|
|
coverOnlyProviders: [
|
|
|
|
{
|
|
|
|
text: 'AudiobookCovers.com',
|
|
|
|
value: 'audiobookcovers'
|
|
|
|
}
|
2022-01-09 00:03:33 +01:00
|
|
|
]
|
2021-10-05 05:11:42 +02:00
|
|
|
})
|
|
|
|
|
2023-10-21 20:53:00 +02:00
|
|
|
export const getters = {}
|
2021-10-05 05:11:42 +02:00
|
|
|
|
2024-01-03 01:36:56 +01:00
|
|
|
export const actions = {
|
|
|
|
reFetchCustom({ dispatch, commit }) {
|
|
|
|
return this.$axios
|
|
|
|
.$get(`/api/custom-metadata-providers`)
|
|
|
|
.then((data) => {
|
|
|
|
const providers = data.providers
|
2021-10-05 05:11:42 +02:00
|
|
|
|
2024-01-03 01:36:56 +01:00
|
|
|
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,
|
|
|
|
}})
|
|
|
|
]
|
|
|
|
},
|
|
|
|
}
|