Minor cleanup
This commit is contained in:
@@ -339,7 +339,7 @@ class ReaderPresenter(
|
||||
newChapters.ref()
|
||||
oldChapters?.unref()
|
||||
|
||||
chapterToDownload = deleteChapterFromDownloadQueue(newChapters.currChapter)
|
||||
chapterToDownload = cancelQueuedDownloads(newChapters.currChapter)
|
||||
viewerChaptersRelay.call(newChapters)
|
||||
}
|
||||
}
|
||||
@@ -489,9 +489,9 @@ class ReaderPresenter(
|
||||
* Removes [currentChapter] from download queue
|
||||
* if setting is enabled and [currentChapter] is queued for download
|
||||
*/
|
||||
private fun deleteChapterFromDownloadQueue(currentChapter: ReaderChapter): Download? {
|
||||
return downloadManager.getChapterDownloadOrNull(currentChapter.chapter.toDomainChapter()!!)?.also {
|
||||
downloadManager.deletePendingDownloads(listOf(it))
|
||||
private fun cancelQueuedDownloads(currentChapter: ReaderChapter): Download? {
|
||||
return downloadManager.getQueuedDownloadOrNull(currentChapter.chapter.id!!.toLong())?.also {
|
||||
downloadManager.cancelQueuedDownloads(listOf(it))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -875,7 +875,7 @@ class ReaderPresenter(
|
||||
val manga = manga ?: return
|
||||
|
||||
presenterScope.launchNonCancellable {
|
||||
downloadManager.enqueueDeleteChapters(listOf(chapter.chapter.toDomainChapter()!!), manga.toDomainManga()!!)
|
||||
downloadManager.enqueueChaptersToDelete(listOf(chapter.chapter.toDomainChapter()!!), manga.toDomainManga()!!)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user