Fix chapters and categories not being added to database

Closes #3278
Fixes #3291
This commit is contained in:
AntsyLich
2026-05-12 02:04:58 +06:00
parent cb2a0ea570
commit b4a3ec0b32
6 changed files with 20 additions and 22 deletions
@@ -28,7 +28,6 @@ class CategoriesRestorer(
val order = nextOrder++
database.categoriesQueries
.insert(it.name, order, it.flags)
.awaitAsOne()
.let { id -> it.toCategory(id).copy(order = order) }
}
@@ -241,7 +241,7 @@ class MangaRestorer(
* @return id of [Manga], null if not found
*/
private suspend fun insertManga(manga: Manga): Long {
return database.mangasQueries.insert(
return database.mangasQueries.insertReturningId(
source = manga.source,
url = manga.url,
artist = manga.artist,