mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-01 01:44:34 -05:00
Add missing transaction context to manga category update (#1516)
fixes #1510
This commit is contained in:
@@ -28,6 +28,7 @@ import suwayomi.tachidesk.manga.model.table.CategoryTable
|
|||||||
import suwayomi.tachidesk.manga.model.table.ChapterTable
|
import suwayomi.tachidesk.manga.model.table.ChapterTable
|
||||||
import suwayomi.tachidesk.manga.model.table.MangaTable
|
import suwayomi.tachidesk.manga.model.table.MangaTable
|
||||||
import suwayomi.tachidesk.manga.model.table.toDataClass
|
import suwayomi.tachidesk.manga.model.table.toDataClass
|
||||||
|
import suwayomi.tachidesk.server.database.dbTransaction
|
||||||
|
|
||||||
object CategoryManga {
|
object CategoryManga {
|
||||||
fun addMangaToCategory(
|
fun addMangaToCategory(
|
||||||
@@ -63,9 +64,11 @@ object CategoryManga {
|
|||||||
newCategoryIds.map { mangaId to it }
|
newCategoryIds.map { mangaId to it }
|
||||||
}
|
}
|
||||||
|
|
||||||
CategoryMangaTable.batchInsert(newMangaCategoryMappings) { (mangaId, categoryId) ->
|
dbTransaction {
|
||||||
this[CategoryMangaTable.manga] = mangaId
|
CategoryMangaTable.batchInsert(newMangaCategoryMappings) { (mangaId, categoryId) ->
|
||||||
this[CategoryMangaTable.category] = categoryId
|
this[CategoryMangaTable.manga] = mangaId
|
||||||
|
this[CategoryMangaTable.category] = categoryId
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user