Fix related to cancelling queued chapters (#8528)

Tachi removes the downloaded chapter (if it exists) when you just cancelled a download from queue.

PR fixes that

Also removes redundant return
This commit is contained in:
AntsyLich
2022-11-19 09:27:39 +06:00
committed by GitHub
parent d60367768b
commit ba2a528886
6 changed files with 11 additions and 35 deletions
@@ -479,7 +479,7 @@ class DownloadController :
presenter.reorder(selectedSeries + otherSeries)
}
R.id.cancel_download -> {
presenter.cancelDownload(item.download)
presenter.cancelDownloads(listOf(item.download))
}
R.id.cancel_series -> {
val allDownloadsForSeries = adapter?.currentItems
@@ -72,11 +72,7 @@ class DownloadPresenter : BasePresenter<DownloadController>() {
downloadManager.reorderQueue(downloads)
}
fun cancelDownload(download: Download) {
downloadManager.deletePendingDownload(download)
}
fun cancelDownloads(downloads: List<Download>) {
downloadManager.deletePendingDownloads(*downloads.toTypedArray())
downloadManager.deletePendingDownloads(downloads)
}
}