mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-06-30 17:34:39 -05:00
Prevent UnsupportedOperationException in DownloadManager (#1521)
CopyOnWriteArraySet does not support the usage of "removeAll" with a predicate
This commit is contained in:
@@ -168,12 +168,14 @@ object DownloadManager {
|
|||||||
downloads: List<DownloadUpdate> = emptyList(),
|
downloads: List<DownloadUpdate> = emptyList(),
|
||||||
gqlEmit: Boolean = false,
|
gqlEmit: Boolean = false,
|
||||||
) {
|
) {
|
||||||
downloadUpdates.removeAll { update ->
|
val outdatedUpdates =
|
||||||
|
downloadUpdates.filter { update ->
|
||||||
downloads.any { download ->
|
downloads.any { download ->
|
||||||
download.downloadChapter.chapter.id ==
|
download.downloadChapter.chapter.id ==
|
||||||
update.downloadChapter.chapter.id
|
update.downloadChapter.chapter.id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
downloadUpdates.removeAll(outdatedUpdates)
|
||||||
downloadUpdates.addAll(downloads)
|
downloadUpdates.addAll(downloads)
|
||||||
|
|
||||||
// There is a problem where too many immediate updates can cause the client to lag out (e.g., in case it has to
|
// There is a problem where too many immediate updates can cause the client to lag out (e.g., in case it has to
|
||||||
|
|||||||
Reference in New Issue
Block a user