mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-27 00:59:14 +01:00
Fix:Crash when updating sequence on series #1919
This commit is contained in:
parent
b715ef3bfc
commit
d0cd512be8
@ -100,6 +100,7 @@ class LibraryItemController {
|
||||
async updateMedia(req, res) {
|
||||
const libraryItem = req.libraryItem
|
||||
const mediaPayload = req.body
|
||||
|
||||
// Item has cover and update is removing cover so purge it from cache
|
||||
if (libraryItem.media.coverPath && (mediaPayload.coverPath === '' || mediaPayload.coverPath === null)) {
|
||||
await this.cacheManager.purgeCoverCache(libraryItem.id)
|
||||
|
@ -119,7 +119,7 @@ module.exports = (sequelize) => {
|
||||
{
|
||||
model: sequelize.models.series,
|
||||
through: {
|
||||
attributes: ['sequence']
|
||||
attributes: ['id', 'sequence']
|
||||
}
|
||||
}
|
||||
]
|
||||
@ -220,7 +220,7 @@ module.exports = (sequelize) => {
|
||||
hasUpdates = true
|
||||
} else if (existingSeriesMatch.bookSeries.sequence !== updatedSeries.sequence) {
|
||||
Logger.dev(`[LibraryItem] "${libraryItemExpanded.media.title}" series "${updatedSeries.name}" sequence was updated from "${existingSeriesMatch.bookSeries.sequence}" to "${updatedSeries.sequence}"`)
|
||||
await existingSeriesMatch.bookSeries.update({ sequence: updatedSeries.sequence })
|
||||
await existingSeriesMatch.bookSeries.update({ id: updatedSeries.id, sequence: updatedSeries.sequence })
|
||||
hasUpdates = true
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user