diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadManager.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadManager.kt index 3e4168895..4a6ffd322 100755 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadManager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadManager.kt @@ -246,7 +246,7 @@ class DownloadManager( // Delete manga directory if empty if (mangaDir?.listFiles()?.isEmpty() == true) { - deleteManga(manga, source) + deleteManga(manga, source, removeQueued = false) } } } @@ -257,10 +257,13 @@ class DownloadManager( * * @param manga the manga to delete. * @param source the source of the manga. + * @param removeQueued whether to also remove queued downloads. */ - fun deleteManga(manga: Manga, source: Source) { + fun deleteManga(manga: Manga, source: Source, removeQueued: Boolean = true) { launchIO { - queue.remove(manga) + if (removeQueued) { + queue.remove(manga) + } provider.findMangaDir(/* SY --> */ manga.ogTitle /* SY <-- */, source)?.delete() cache.removeManga(manga)