mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-09 07:14:52 +02:00
Add:Batch append details #848
This commit is contained in:
@ -107,14 +107,24 @@ export default {
|
||||
author: this.details.author
|
||||
}
|
||||
},
|
||||
mapBatchDetails(batchDetails) {
|
||||
mapBatchDetails(batchDetails, mapType = 'overwrite') {
|
||||
for (const key in batchDetails) {
|
||||
if (key === 'tags') {
|
||||
this.newTags = [...batchDetails.tags]
|
||||
} else if (key === 'genres') {
|
||||
this.details[key] = [...batchDetails[key]]
|
||||
if (mapType === 'append') {
|
||||
if (key === 'tags') {
|
||||
// Concat and remove dupes
|
||||
this.newTags = [...new Set(this.newTags.concat(batchDetails.tags))]
|
||||
} else if (key === 'genres') {
|
||||
// Concat and remove dupes
|
||||
this.details[key] = [...new Set(this.details[key].concat(batchDetails[key]))]
|
||||
}
|
||||
} else {
|
||||
this.details[key] = batchDetails[key]
|
||||
if (key === 'tags') {
|
||||
this.newTags = [...batchDetails.tags]
|
||||
} else if (key === 'genres') {
|
||||
this.details[key] = [...batchDetails[key]]
|
||||
} else {
|
||||
this.details[key] = batchDetails[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user