Don't remove queued downloads when deleting manga after chapter deletion

(cherry picked from commit 5fbecfd7b747b3961699fe63eb9264eac495794b)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadManager.kt
This commit is contained in:
arkon 2022-11-27 17:12:38 -05:00 committed by Jobobby04
parent 9b46395fd8
commit 11ab8925b3

View File

@ -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)