mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-10-21 06:52:18 +02:00
perf(downloads): batch queue cancellation and progress cleanup
This commit is contained in:
1 parent
c67d2a2dd2
commit
2ded1cff68
10 files changed
+562
-24
No files matched your search
@@ -880,11 +880,14 @@ internal object RustCoreBackend : CoreBackend {
|
||||
environment.downloadState().use { state -> state.allProgress() }
|
||||
}
|
||||
"cleanupConnections" -> current.environment().use { it.cleanupConnections(); null }
|
||||
"resetDownloadCancels" -> {
|
||||
"resetDownloadCancels", "cancelDownloads" -> {
|
||||
val values = args["item_ids"] as? List<*> ?: error("Expected item_ids list")
|
||||
val itemIds = values.map { it as? String ?: error("Expected string item ID") }
|
||||
current.environment().use { environment ->
|
||||
environment.downloadState().use { it.resetDownloadCancels(itemIds) }
|
||||
environment.downloadState().use { state ->
|
||||
if (method == "cancelDownloads") state.cancelDownloads(itemIds)
|
||||
else state.resetDownloadCancels(itemIds)
|
||||
}
|
||||
}
|
||||
null
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user