Add batch endpoint for removing downloads from download queue (#452)

This commit is contained in:
Valter Martinek
2022-11-16 17:31:48 +01:00
committed by GitHub
parent 67e09e2e1d
commit d6127d6811
3 changed files with 31 additions and 0 deletions

View File

@@ -190,6 +190,14 @@ object DownloadManager {
addMultipleToQueue(inputPairs)
}
fun unqueue(input: EnqueueInput) {
if (input.chapterIds.isNullOrEmpty()) return
downloadQueue.removeIf { it.chapter.id in input.chapterIds }
notifyAllClients()
}
/**
* Tries to add multiple inputs to queue
* If any of inputs was actually added to queue, starts the queue