mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-25 14:01:51 +01:00
Fixed issue with canceling a downloading in manga details when there's more downloads
This commit is contained in:
parent
0d702e0c2b
commit
5fa9d211aa
@ -1058,7 +1058,7 @@ class MangaDetailsController : BaseController,
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (chapter.status != Download.NOT_DOWNLOADED && chapter.status != Download.ERROR) {
|
if (chapter.status != Download.NOT_DOWNLOADED && chapter.status != Download.ERROR) {
|
||||||
presenter.deleteChapters(listOf(chapter))
|
presenter.deleteChapter(chapter)
|
||||||
} else {
|
} else {
|
||||||
if (chapter.status == Download.ERROR)
|
if (chapter.status == Download.ERROR)
|
||||||
DownloadService.start(view.context)
|
DownloadService.start(view.context)
|
||||||
|
@ -340,6 +340,24 @@ class MangaDetailsPresenter(
|
|||||||
downloadManager.downloadChapters(manga, chapters.filter { !it.isDownloaded })
|
downloadManager.downloadChapters(manga, chapters.filter { !it.isDownloaded })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deletes the given list of chapter.
|
||||||
|
* @param chapter the chapter to delete.
|
||||||
|
*/
|
||||||
|
fun deleteChapter(chapter: ChapterItem) {
|
||||||
|
downloadManager.deleteChapters(listOf(chapter), manga, source)
|
||||||
|
val downloads = downloadManager.queue.toMutableList()
|
||||||
|
downloads.remove(chapter.download)
|
||||||
|
downloadManager.reorderQueue(downloads)
|
||||||
|
|
||||||
|
this.chapters.find { it.id == chapter.id }?.apply {
|
||||||
|
status = Download.NOT_DOWNLOADED
|
||||||
|
download = null
|
||||||
|
}
|
||||||
|
|
||||||
|
controller.updateChapters(this.chapters)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes the given list of chapter.
|
* Deletes the given list of chapter.
|
||||||
* @param chapters the list of chapters to delete.
|
* @param chapters the list of chapters to delete.
|
||||||
|
Loading…
Reference in New Issue
Block a user