mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-06-28 09:15:48 -04:00
prettier
This commit is contained in:
parent
a6422bb3fc
commit
ad2c5c29e1
3 changed files with 13 additions and 13 deletions
|
@ -112,11 +112,11 @@ export const state = () => ({
|
||||||
})
|
})
|
||||||
|
|
||||||
export const getters = {
|
export const getters = {
|
||||||
checkBookProviderExists: state => (providerValue) => {
|
checkBookProviderExists: (state) => (providerValue) => {
|
||||||
return state.providers.some(p => p.value === providerValue)
|
return state.providers.some((p) => p.value === providerValue)
|
||||||
},
|
},
|
||||||
checkPodcastProviderExists: state => (providerValue) => {
|
checkPodcastProviderExists: (state) => (providerValue) => {
|
||||||
return state.podcastProviders.some(p => p.value === providerValue)
|
return state.podcastProviders.some((p) => p.value === providerValue)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,13 +125,13 @@ export const actions = {}
|
||||||
export const mutations = {
|
export const mutations = {
|
||||||
addCustomMetadataProvider(state, provider) {
|
addCustomMetadataProvider(state, provider) {
|
||||||
if (provider.mediaType === 'book') {
|
if (provider.mediaType === 'book') {
|
||||||
if (state.providers.some(p => p.value === provider.slug)) return
|
if (state.providers.some((p) => p.value === provider.slug)) return
|
||||||
state.providers.push({
|
state.providers.push({
|
||||||
text: provider.name,
|
text: provider.name,
|
||||||
value: provider.slug
|
value: provider.slug
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
if (state.podcastProviders.some(p => p.value === provider.slug)) return
|
if (state.podcastProviders.some((p) => p.value === provider.slug)) return
|
||||||
state.podcastProviders.push({
|
state.podcastProviders.push({
|
||||||
text: provider.name,
|
text: provider.name,
|
||||||
value: provider.slug
|
value: provider.slug
|
||||||
|
@ -140,9 +140,9 @@ export const mutations = {
|
||||||
},
|
},
|
||||||
removeCustomMetadataProvider(state, provider) {
|
removeCustomMetadataProvider(state, provider) {
|
||||||
if (provider.mediaType === 'book') {
|
if (provider.mediaType === 'book') {
|
||||||
state.providers = state.providers.filter(p => p.value !== provider.slug)
|
state.providers = state.providers.filter((p) => p.value !== provider.slug)
|
||||||
} else {
|
} else {
|
||||||
state.podcastProviders = state.podcastProviders.filter(p => p.value !== provider.slug)
|
state.podcastProviders = state.podcastProviders.filter((p) => p.value !== provider.slug)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setCustomMetadataProviders(state, providers) {
|
setCustomMetadataProviders(state, providers) {
|
||||||
|
|
|
@ -205,8 +205,7 @@ class BookFinder {
|
||||||
*/
|
*/
|
||||||
async getAudiMetaResults(title, author, asin, provider) {
|
async getAudiMetaResults(title, author, asin, provider) {
|
||||||
// Ensure provider is a string (See CodeQL) even though it should be a string anyway
|
// Ensure provider is a string (See CodeQL) even though it should be a string anyway
|
||||||
const providerStr = (typeof provider === 'string' ? provider :
|
const providerStr = (typeof provider === 'string' ? provider : Array.isArray(provider) ? provider[0]?.toString() || '' : '').toString()
|
||||||
(Array.isArray(provider) ? provider[0]?.toString() || '' : '')).toString()
|
|
||||||
|
|
||||||
const region = providerStr.includes('.') ? providerStr.split('.').pop() : ''
|
const region = providerStr.includes('.') ? providerStr.split('.').pop() : ''
|
||||||
const books = await this.audiMeta.search(title, author, asin, region, this.#providerResponseTimeout)
|
const books = await this.audiMeta.search(title, author, asin, region, this.#providerResponseTimeout)
|
||||||
|
|
|
@ -50,7 +50,7 @@ class AudiMeta {
|
||||||
series: s.name,
|
series: s.name,
|
||||||
sequence: this.cleanSeriesSequence(s.name, (s.position || '').toString())
|
sequence: this.cleanSeriesSequence(s.name, (s.position || '').toString())
|
||||||
})
|
})
|
||||||
});
|
})
|
||||||
|
|
||||||
// Tags and Genres are flipped for AudiMeta
|
// Tags and Genres are flipped for AudiMeta
|
||||||
const genresFiltered = genres ? genres.filter((g) => g.type == 'Tags').map((g) => g.name) : []
|
const genresFiltered = genres ? genres.filter((g) => g.type == 'Tags').map((g) => g.name) : []
|
||||||
|
@ -147,7 +147,8 @@ class AudiMeta {
|
||||||
items = await axios
|
items = await axios
|
||||||
.get(url, {
|
.get(url, {
|
||||||
timeout
|
timeout
|
||||||
}).then((res) => {
|
})
|
||||||
|
.then((res) => {
|
||||||
return res.data
|
return res.data
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue