diff --git a/app/src/main/java/com/lagradost/cloudstream3/utils/downloader/DownloadQueueManager.kt b/app/src/main/java/com/lagradost/cloudstream3/utils/downloader/DownloadQueueManager.kt index f3866408833..cf2a039dfdb 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/utils/downloader/DownloadQueueManager.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/utils/downloader/DownloadQueueManager.kt @@ -198,8 +198,11 @@ object DownloadQueueManager { } } - /** Removes all queued items */ + /** /** Removes all inactive downloads */ */ fun removeAllFromQueue() { + downloadInstances.value + .filter { downloadStatus[it.downloadQueueWrapper.id] != VideoDownloadManager.DownloadType.IsDownloading } + .forEach { it.cancelDownload() } removeAll().forEach { wrapper -> setQueueStatus(wrapper.id, VideoDownloadManager.DownloadType.IsStopped) }