mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-04 03:14:40 -05:00
Only batch update in case list is not empty (#747)
Apparently "BatchUpdateStatement" can't handle an empty data set
This commit is contained in:
@@ -175,18 +175,20 @@ object Chapter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BatchUpdateStatement(ChapterTable).apply {
|
if (chaptersToUpdate.isNotEmpty()) {
|
||||||
chaptersToUpdate.forEach {
|
BatchUpdateStatement(ChapterTable).apply {
|
||||||
addBatch(EntityID(it.id, ChapterTable))
|
chaptersToUpdate.forEach {
|
||||||
this[ChapterTable.name] = it.name
|
addBatch(EntityID(it.id, ChapterTable))
|
||||||
this[ChapterTable.date_upload] = it.uploadDate
|
this[ChapterTable.name] = it.name
|
||||||
this[ChapterTable.chapter_number] = it.chapterNumber
|
this[ChapterTable.date_upload] = it.uploadDate
|
||||||
this[ChapterTable.scanlator] = it.scanlator
|
this[ChapterTable.chapter_number] = it.chapterNumber
|
||||||
this[ChapterTable.sourceOrder] = it.index
|
this[ChapterTable.scanlator] = it.scanlator
|
||||||
this[ChapterTable.fetchedAt] = it.fetchedAt
|
this[ChapterTable.sourceOrder] = it.index
|
||||||
this[ChapterTable.realUrl] = it.realUrl
|
this[ChapterTable.fetchedAt] = it.fetchedAt
|
||||||
|
this[ChapterTable.realUrl] = it.realUrl
|
||||||
|
}
|
||||||
|
execute(this@transaction)
|
||||||
}
|
}
|
||||||
execute(this@transaction)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MangaTable.update({ MangaTable.id eq mangaId }) {
|
MangaTable.update({ MangaTable.id eq mangaId }) {
|
||||||
|
|||||||
Reference in New Issue
Block a user