mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
chore: Use non cancelable for some functions
This commit is contained in:
parent
50d6f7293d
commit
8922b5ecbf
1 changed files with 4 additions and 4 deletions
|
@ -44,7 +44,7 @@ import eu.kanade.tachiyomi.util.lang.removeArticles
|
|||
import eu.kanade.tachiyomi.util.manga.MangaCoverMetadata
|
||||
import eu.kanade.tachiyomi.util.mapStatus
|
||||
import eu.kanade.tachiyomi.util.system.executeOnIO
|
||||
import eu.kanade.tachiyomi.util.system.launchIO
|
||||
import eu.kanade.tachiyomi.util.system.launchNonCancellable
|
||||
import eu.kanade.tachiyomi.util.system.launchUI
|
||||
import eu.kanade.tachiyomi.util.system.withIOContext
|
||||
import eu.kanade.tachiyomi.util.system.withUIContext
|
||||
|
@ -1156,7 +1156,7 @@ class LibraryPresenter(
|
|||
|
||||
/** Remove manga from the library and delete the downloads */
|
||||
fun confirmDeletion(mangas: List<Manga>, coverCacheToo: Boolean = true) {
|
||||
launchIO {
|
||||
presenterScope.launchNonCancellable {
|
||||
val mangaToDelete = mangas.distinctBy { it.id }
|
||||
mangaToDelete.forEach { manga ->
|
||||
if (coverCacheToo) {
|
||||
|
@ -1372,7 +1372,7 @@ class LibraryPresenter(
|
|||
markRead: Boolean,
|
||||
): HashMap<Manga, List<Chapter>> {
|
||||
val mapMangaChapters = HashMap<Manga, List<Chapter>>()
|
||||
presenterScope.launchIO {
|
||||
presenterScope.launchNonCancellable {
|
||||
mangaList.forEach { manga ->
|
||||
val chapters = getChapters.await(manga)
|
||||
val updates = chapters.copy().mapNotNull {
|
||||
|
@ -1391,7 +1391,7 @@ class LibraryPresenter(
|
|||
fun undoMarkReadStatus(
|
||||
mangaList: HashMap<Manga, List<Chapter>>,
|
||||
) {
|
||||
launchIO {
|
||||
presenterScope.launchNonCancellable {
|
||||
val updates = mangaList.values.map { chapters ->
|
||||
chapters.mapNotNull {
|
||||
if (it.id == null) return@mapNotNull null
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue