mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-13 01:55:06 +01:00
Fixed cancelled updates not showing updates for manga that still got an update
This commit is contained in:
parent
1dd9aa5e69
commit
c2f7c25d70
@ -207,6 +207,10 @@ class LibraryUpdateService(
|
|||||||
*/
|
*/
|
||||||
fun stop(context: Context) {
|
fun stop(context: Context) {
|
||||||
instance?.job?.cancel()
|
instance?.job?.cancel()
|
||||||
|
GlobalScope.launch {
|
||||||
|
instance?.jobCount?.set(0)
|
||||||
|
instance?.finishUpdates()
|
||||||
|
}
|
||||||
context.stopService(Intent(context, LibraryUpdateService::class.java))
|
context.stopService(Intent(context, LibraryUpdateService::class.java))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -241,10 +245,8 @@ class LibraryUpdateService(
|
|||||||
}
|
}
|
||||||
hasDownloads = hasDownloads || hasDLs
|
hasDownloads = hasDownloads || hasDLs
|
||||||
jobCount.andDecrement
|
jobCount.andDecrement
|
||||||
if (job?.isCancelled != false) {
|
|
||||||
finishUpdates()
|
finishUpdates()
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
val list = mangaToUpdateMap[it.key] ?: emptyList()
|
val list = mangaToUpdateMap[it.key] ?: emptyList()
|
||||||
mangaToUpdateMap[it.key] = (list + it.value)
|
mangaToUpdateMap[it.key] = (list + it.value)
|
||||||
@ -362,7 +364,7 @@ class LibraryUpdateService(
|
|||||||
}
|
}
|
||||||
job = GlobalScope.launch(handler) {
|
job = GlobalScope.launch(handler) {
|
||||||
when (target) {
|
when (target) {
|
||||||
Target.CHAPTERS ->updateChaptersJob(mangaToAdd)
|
Target.CHAPTERS -> updateChaptersJob(mangaToAdd)
|
||||||
Target.DETAILS -> updateDetails(mangaToAdd)
|
Target.DETAILS -> updateDetails(mangaToAdd)
|
||||||
else -> updateTrackings(mangaToAdd)
|
else -> updateTrackings(mangaToAdd)
|
||||||
}
|
}
|
||||||
@ -406,6 +408,7 @@ class LibraryUpdateService(
|
|||||||
} else if (downloadNew && hasDownloads) {
|
} else if (downloadNew && hasDownloads) {
|
||||||
DownloadService.start(this)
|
DownloadService.start(this)
|
||||||
}
|
}
|
||||||
|
newUpdates.clear()
|
||||||
}
|
}
|
||||||
cancelProgressNotification()
|
cancelProgressNotification()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user