Use transaction on restore to go brr. (#10375)
refactor: use transaction to go brr. This improve the restore speed on fresh db and non fresh db. Signed-off-by: KaiserBh <kaiserbh@proton.me> (cherry picked from commit b1067b942ef5c8d53e5ab838ef078789b9c0627a) # Conflicts: # app/src/main/java/eu/kanade/tachiyomi/data/backup/restore/restorers/MangaRestorer.kt
This commit is contained in:
parent
f24d50af44
commit
f6407805d3
@ -71,6 +71,7 @@ class MangaRestorer(
|
|||||||
backupManga: BackupManga,
|
backupManga: BackupManga,
|
||||||
backupCategories: List<BackupCategory>,
|
backupCategories: List<BackupCategory>,
|
||||||
) {
|
) {
|
||||||
|
handler.await(inTransaction = true) {
|
||||||
val dbManga = findExistingManga(backupManga)
|
val dbManga = findExistingManga(backupManga)
|
||||||
var manga = backupManga.getMangaImpl()
|
var manga = backupManga.getMangaImpl()
|
||||||
// SY -->
|
// SY -->
|
||||||
@ -96,6 +97,7 @@ class MangaRestorer(
|
|||||||
// SY <--
|
// SY <--
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private suspend fun findExistingManga(backupManga: BackupManga): Manga? {
|
private suspend fun findExistingManga(backupManga: BackupManga): Manga? {
|
||||||
return getMangaByUrlAndSourceId.await(backupManga.url, backupManga.source)
|
return getMangaByUrlAndSourceId.await(backupManga.url, backupManga.source)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user