Use the same thread for db operations in places where trans are possible
This commit is contained in:
@@ -134,7 +134,9 @@ class GalleryAdder {
|
||||
}
|
||||
|
||||
// Fetch and copy details
|
||||
val newManga = source.getMangaDetails(manga.toMangaInfo())
|
||||
val newManga = maybeRunBlocking(protectTrans) {
|
||||
source.getMangaDetails(manga.toMangaInfo())
|
||||
}
|
||||
manga.copyFrom(newManga.toSManga())
|
||||
manga.initialized = true
|
||||
|
||||
|
||||
@@ -48,9 +48,9 @@ class ApiMangaParser(
|
||||
}
|
||||
|
||||
suspend fun parseToManga(manga: MangaInfo, input: MangaResponse, sourceId: Long): MangaInfo {
|
||||
val mangaId = db.getManga(manga.key, sourceId).executeOnIO()?.id
|
||||
val mangaId = db.getManga(manga.key, sourceId).executeAsBlocking()?.id
|
||||
val metadata = if (mangaId != null) {
|
||||
val flatMetadata = db.getFlatMetadataForManga(mangaId).executeOnIO()
|
||||
val flatMetadata = db.getFlatMetadataForManga(mangaId).executeAsBlocking()
|
||||
flatMetadata?.raise(metaClass) ?: newMetaInstance()
|
||||
} else newMetaInstance()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user