mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-06 22:19:04 +01:00
Fix:Match tab #708
This commit is contained in:
parent
2079942ccd
commit
b2880ab0a9
@ -365,7 +365,8 @@ export default {
|
|||||||
else this.provider = localStorage.getItem('book-provider') || 'google'
|
else this.provider = localStorage.getItem('book-provider') || 'google'
|
||||||
},
|
},
|
||||||
selectMatch(match) {
|
selectMatch(match) {
|
||||||
if (match && match.series) {
|
if (match) {
|
||||||
|
if (match.series) {
|
||||||
if (!match.series.length) {
|
if (!match.series.length) {
|
||||||
delete match.series
|
delete match.series
|
||||||
} else {
|
} else {
|
||||||
@ -379,7 +380,12 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (match.genres && Array.isArray(match.genres)) {
|
||||||
|
match.genres = match.genres.join(',')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('Select Match', match)
|
||||||
this.selectedMatch = match
|
this.selectedMatch = match
|
||||||
},
|
},
|
||||||
buildMatchUpdatePayload() {
|
buildMatchUpdatePayload() {
|
||||||
@ -409,11 +415,12 @@ export default {
|
|||||||
|
|
||||||
updatePayload.metadata.series = seriesPayload
|
updatePayload.metadata.series = seriesPayload
|
||||||
} else if (key === 'author' && !this.isPodcast) {
|
} else if (key === 'author' && !this.isPodcast) {
|
||||||
if (!Array.isArray(this.selectedMatch[key])) {
|
var authors = this.selectedMatch[key]
|
||||||
this.selectedMatch[key] = this.selectedMatch[key].split(',').map((au) => au.trim())
|
if (!Array.isArray(authors)) {
|
||||||
|
authors = authors.split(',').map((au) => au.trim())
|
||||||
}
|
}
|
||||||
var authorPayload = []
|
var authorPayload = []
|
||||||
this.selectedMatch[key].forEach((authorName) =>
|
authors.forEach((authorName) =>
|
||||||
authorPayload.push({
|
authorPayload.push({
|
||||||
id: `new-${Math.floor(Math.random() * 10000)}`,
|
id: `new-${Math.floor(Math.random() * 10000)}`,
|
||||||
name: authorName
|
name: authorName
|
||||||
@ -423,9 +430,9 @@ export default {
|
|||||||
} else if (key === 'narrator') {
|
} else if (key === 'narrator') {
|
||||||
updatePayload.metadata.narrators = [this.selectedMatch[key]]
|
updatePayload.metadata.narrators = [this.selectedMatch[key]]
|
||||||
} else if (key === 'genres') {
|
} else if (key === 'genres') {
|
||||||
updatePayload.metadata.genres = this.selectedMatch[key].split(',')
|
updatePayload.metadata.genres = this.selectedMatch[key].split(',').map((v) => v.trim())
|
||||||
} else if (key === 'tags') {
|
} else if (key === 'tags') {
|
||||||
updatePayload.tags = this.selectedMatch[key].split(',')
|
updatePayload.tags = this.selectedMatch[key].split(',').map((v) => v.trim())
|
||||||
} else if (key === 'itunesId') {
|
} else if (key === 'itunesId') {
|
||||||
updatePayload.metadata.itunesId = Number(this.selectedMatch[key])
|
updatePayload.metadata.itunesId = Number(this.selectedMatch[key])
|
||||||
} else {
|
} else {
|
||||||
@ -441,6 +448,8 @@ export default {
|
|||||||
if (!Object.keys(updatePayload).length) {
|
if (!Object.keys(updatePayload).length) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('Match payload', updatePayload)
|
||||||
this.isProcessing = true
|
this.isProcessing = true
|
||||||
|
|
||||||
if (updatePayload.metadata.cover) {
|
if (updatePayload.metadata.cover) {
|
||||||
|
Loading…
Reference in New Issue
Block a user