Fix:Matching authors with multiple authors split by comma #667

This commit is contained in:
advplyr 2022-06-03 19:21:31 -05:00
parent e8cd18eac2
commit 0e1692d26b

View File

@ -366,6 +366,9 @@ export default {
}, },
selectMatch(match) { selectMatch(match) {
if (match && match.series) { if (match && match.series) {
if (!match.series.length) {
delete match.series
} else {
match.series = match.series.map((se) => { match.series = match.series.map((se) => {
return { return {
id: `new-${Math.floor(Math.random() * 10000)}`, id: `new-${Math.floor(Math.random() * 10000)}`,
@ -375,6 +378,7 @@ export default {
} }
}) })
} }
}
this.selectedMatch = match this.selectedMatch = match
}, },
@ -405,7 +409,9 @@ 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])) this.selectedMatch[key] = [this.selectedMatch[key]] if (!Array.isArray(this.selectedMatch[key])) {
this.selectedMatch[key] = this.selectedMatch[key].split(',').map((au) => au.trim())
}
var authorPayload = [] var authorPayload = []
this.selectedMatch[key].forEach((authorName) => this.selectedMatch[key].forEach((authorName) =>
authorPayload.push({ authorPayload.push({