mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-20 19:06:06 +01:00
Fix:Error adding new series if a series has a null title #3622
This commit is contained in:
parent
778256ca16
commit
a5e38d1473
@ -71,8 +71,6 @@ export default {
|
|||||||
this.showSeriesForm = true
|
this.showSeriesForm = true
|
||||||
},
|
},
|
||||||
submitSeriesForm() {
|
submitSeriesForm() {
|
||||||
console.log('submit series form', this.value, this.selectedSeries)
|
|
||||||
|
|
||||||
if (!this.selectedSeries.name) {
|
if (!this.selectedSeries.name) {
|
||||||
this.$toast.error('Must enter a series')
|
this.$toast.error('Must enter a series')
|
||||||
return
|
return
|
||||||
|
@ -29,7 +29,12 @@ class BookMetadata {
|
|||||||
this.subtitle = metadata.subtitle
|
this.subtitle = metadata.subtitle
|
||||||
this.authors = metadata.authors?.map ? metadata.authors.map((a) => ({ ...a })) : []
|
this.authors = metadata.authors?.map ? metadata.authors.map((a) => ({ ...a })) : []
|
||||||
this.narrators = metadata.narrators ? [...metadata.narrators].filter((n) => n) : []
|
this.narrators = metadata.narrators ? [...metadata.narrators].filter((n) => n) : []
|
||||||
this.series = metadata.series?.map ? metadata.series.map((s) => ({ ...s })) : []
|
this.series = metadata.series?.map
|
||||||
|
? metadata.series.map((s) => ({
|
||||||
|
...s,
|
||||||
|
name: s.name || 'No Title'
|
||||||
|
}))
|
||||||
|
: []
|
||||||
this.genres = metadata.genres ? [...metadata.genres] : []
|
this.genres = metadata.genres ? [...metadata.genres] : []
|
||||||
this.publishedYear = metadata.publishedYear || null
|
this.publishedYear = metadata.publishedYear || null
|
||||||
this.publishedDate = metadata.publishedDate || null
|
this.publishedDate = metadata.publishedDate || null
|
||||||
|
@ -662,7 +662,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
attributes: ['id', 'name']
|
attributes: ['id', 'name']
|
||||||
})
|
})
|
||||||
series.forEach((s) => data.series.push({ id: s.id, name: s.name }))
|
series.forEach((s) => data.series.push({ id: s.id, name: s.name || 'No Title' }))
|
||||||
|
|
||||||
const authors = await Database.authorModel.findAll({
|
const authors = await Database.authorModel.findAll({
|
||||||
where: {
|
where: {
|
||||||
|
Loading…
Reference in New Issue
Block a user