From 8a668ba7b9f0ae11612ab3202de40624f330abf2 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 23 Jan 2021 19:24:55 -0500 Subject: [PATCH] Revert async metadata updates to fix lag when updating (fixes #4341) --- .../data/library/LibraryUpdateService.kt | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt b/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt index 6d4c09d6d..43f7d39ed 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt @@ -329,19 +329,17 @@ class LibraryUpdateService( // Update manga details metadata in the background if (preferences.autoUpdateMetadata()) { - scope.async { - val updatedManga = source.getMangaDetails(manga.toMangaInfo()) - val sManga = updatedManga.toSManga() - // Avoid "losing" existing cover - if (!sManga.thumbnail_url.isNullOrEmpty()) { - manga.prepUpdateCover(coverCache, sManga, false) - } else { - sManga.thumbnail_url = manga.thumbnail_url - } - - manga.copyFrom(sManga) - db.insertManga(manga).executeAsBlocking() + val updatedManga = source.getMangaDetails(manga.toMangaInfo()) + val sManga = updatedManga.toSManga() + // Avoid "losing" existing cover + if (!sManga.thumbnail_url.isNullOrEmpty()) { + manga.prepUpdateCover(coverCache, sManga, false) + } else { + sManga.thumbnail_url = manga.thumbnail_url } + + manga.copyFrom(sManga) + db.insertManga(manga).executeAsBlocking() } val chapters = source.getChapterList(manga.toMangaInfo())