Skip to content

Commit

Permalink
Add some more global launches
Browse files Browse the repository at this point in the history
  • Loading branch information
nonproto committed Feb 7, 2025
1 parent 8fe5084 commit 720caa2
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,9 @@ class DownloadManager(val context: Context) {
*/
fun deleteChapters(chapters: List<Chapter>, manga: Manga) {
GlobalScope.launchNonCancellable {
cache.removeChapters(chapters, manga)
removeFromDownloadQueue(chapters)
launchNonCancellable { cache.removeChapters(chapters, manga) }
launchNonCancellable { removeFromDownloadQueue(chapters) }

try {

val mangaDir = provider.findMangaDir(manga)
Expand All @@ -262,10 +263,10 @@ class DownloadManager(val context: Context) {
provider.findTempChapterDirs(chapters, manga)

if (chapterDirs.isEmpty()) {
pendingDeleter.deletePendingChapter(manga, chapters)
launchNonCancellable { pendingDeleter.deletePendingChapter(manga, chapters) }
} else {

GlobalScope.launchNonCancellable {
launchNonCancellable {
chapterDirs.forEach {
it.delete()
pendingDeleter.deletePendingChapter(manga, chapters)
Expand Down

0 comments on commit 720caa2

Please sign in to comment.