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,14 +366,18 @@ export default {
}, },
selectMatch(match) { selectMatch(match) {
if (match && match.series) { if (match && match.series) {
match.series = match.series.map((se) => { if (!match.series.length) {
return { delete match.series
id: `new-${Math.floor(Math.random() * 10000)}`, } else {
displayName: se.volumeNumber ? `${se.series} #${se.volumeNumber}` : se.series, match.series = match.series.map((se) => {
name: se.series, return {
sequence: se.volumeNumber || '' id: `new-${Math.floor(Math.random() * 10000)}`,
} displayName: se.volumeNumber ? `${se.series} #${se.volumeNumber}` : se.series,
}) name: se.series,
sequence: se.volumeNumber || ''
}
})
}
} }
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({