Revert async metadata updates to fix lag when updating (fixes #4341)

This commit is contained in:
arkon 2021-01-23 19:24:55 -05:00
parent ee9a68b040
commit 8a668ba7b9

View file

@ -329,19 +329,17 @@ class LibraryUpdateService(
// Update manga details metadata in the background // Update manga details metadata in the background
if (preferences.autoUpdateMetadata()) { if (preferences.autoUpdateMetadata()) {
scope.async { val updatedManga = source.getMangaDetails(manga.toMangaInfo())
val updatedManga = source.getMangaDetails(manga.toMangaInfo()) val sManga = updatedManga.toSManga()
val sManga = updatedManga.toSManga() // Avoid "losing" existing cover
// Avoid "losing" existing cover if (!sManga.thumbnail_url.isNullOrEmpty()) {
if (!sManga.thumbnail_url.isNullOrEmpty()) { manga.prepUpdateCover(coverCache, sManga, false)
manga.prepUpdateCover(coverCache, sManga, false) } else {
} else { sManga.thumbnail_url = manga.thumbnail_url
sManga.thumbnail_url = manga.thumbnail_url
}
manga.copyFrom(sManga)
db.insertManga(manga).executeAsBlocking()
} }
manga.copyFrom(sManga)
db.insertManga(manga).executeAsBlocking()
} }
val chapters = source.getChapterList(manga.toMangaInfo()) val chapters = source.getChapterList(manga.toMangaInfo())