From e8c35ae4e1d93a814bb19283f5013de02096e2c9 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 6 Feb 2021 12:14:55 -0500 Subject: [PATCH] Do a regular return to cancel update jobs instead of throwing an exception --- .../kanade/tachiyomi/data/library/LibraryUpdateService.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 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 d337834d1f..27e135a7d6 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 @@ -33,7 +33,6 @@ import eu.kanade.tachiyomi.util.storage.getUriCompat import eu.kanade.tachiyomi.util.system.acquireWakeLock import eu.kanade.tachiyomi.util.system.createFileInCacheDir import eu.kanade.tachiyomi.util.system.isServiceRunning -import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CoroutineExceptionHandler import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -257,7 +256,7 @@ class LibraryUpdateService( mangaToUpdate .map { manga -> if (updateJob?.isActive != true) { - throw CancellationException() + return } // Notify manga that will update. @@ -360,7 +359,7 @@ class LibraryUpdateService( mangaToUpdate.forEach { manga -> if (updateJob?.isActive != true) { - throw CancellationException() + return } notifier.showProgressNotification(manga, progressCount++, mangaToUpdate.size) @@ -394,7 +393,7 @@ class LibraryUpdateService( mangaToUpdate.forEach { manga -> if (updateJob?.isActive != true) { - throw CancellationException() + return } // Notify manga that will update.