Fixed cancelled updates not showing updates for manga that still got an update

This commit is contained in:
Jay 2020-05-09 12:26:08 -04:00
parent 1dd9aa5e69
commit c2f7c25d70

View File

@ -207,6 +207,10 @@ class LibraryUpdateService(
*/
fun stop(context: Context) {
instance?.job?.cancel()
GlobalScope.launch {
instance?.jobCount?.set(0)
instance?.finishUpdates()
}
context.stopService(Intent(context, LibraryUpdateService::class.java))
}
@ -241,10 +245,8 @@ class LibraryUpdateService(
}
hasDownloads = hasDownloads || hasDLs
jobCount.andDecrement
if (job?.isCancelled != false) {
finishUpdates()
}
}
} else {
val list = mangaToUpdateMap[it.key] ?: emptyList()
mangaToUpdateMap[it.key] = (list + it.value)
@ -406,6 +408,7 @@ class LibraryUpdateService(
} else if (downloadNew && hasDownloads) {
DownloadService.start(this)
}
newUpdates.clear()
}
cancelProgressNotification()
}