mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-12 12:08:56 +01:00
Add cancel all for series in download queue (#5062)
Co-authored-by: Jays2Kings <jays@outlook.com>
This commit is contained in:
@@ -203,6 +203,15 @@ class DownloadManager(private val context: Context) {
|
||||
deleteChapters(listOf(download.chapter), download.manga, download.source)
|
||||
}
|
||||
|
||||
fun deletePendingDownloads(vararg downloads: Download) {
|
||||
val downloadsByManga = downloads.groupBy { it.manga.id }
|
||||
downloadsByManga.map { entry ->
|
||||
val manga = entry.value.first().manga
|
||||
val source = entry.value.first().source
|
||||
deleteChapters(entry.value.map { it.chapter }, manga, source)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes the directories of a list of downloaded chapters.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user