audiobookshelf/client/store/scanners.js
Spenser Bushey f9ed412e4e Add AudiobookCovers.com metadata provider
AudiobookCovers.com acts as a cover-only metadata provider, therefore will only show up in the covers selector.
2023-04-19 22:13:52 -07:00

97 lines
1.6 KiB
JavaScript

export const state = () => ({
libraryScans: [],
providers: [
{
text: 'Google Books',
value: 'google'
},
{
text: 'Open Library',
value: 'openlibrary'
},
{
text: 'iTunes',
value: 'itunes'
},
{
text: 'Audible.com',
value: 'audible'
},
{
text: 'Audible.ca',
value: 'audible.ca'
},
{
text: 'Audible.co.uk',
value: 'audible.uk'
},
{
text: 'Audible.com.au',
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'
},
{
text: 'FantLab.ru',
value: 'fantlab'
}
],
podcastProviders: [
{
text: 'iTunes',
value: 'itunes'
}
],
coverOnlyProviders: [
{
text: 'AudiobookCovers.com',
value: 'audiobookcovers'
}
]
})
export const getters = {
getLibraryScan: state => id => {
return state.libraryScans.find(ls => ls.id === id)
}
}
export const actions = {
}
export const mutations = {
addUpdate(state, data) {
var index = state.libraryScans.findIndex(lib => lib.id === data.id)
if (index >= 0) {
state.libraryScans.splice(index, 1, data)
} else {
state.libraryScans.push(data)
}
},
remove(state, data) {
state.libraryScans = state.libraryScans.filter(scan => scan.id !== data.id)
}
}