mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-07-09 03:25:09 +00:00
Improved performance for large download queues
This commit is contained in:
@@ -19,7 +19,7 @@ class DownloadHandler implements IPCEmitHandler<'download'> {
|
||||
}
|
||||
|
||||
private addDownload(data: Download) {
|
||||
const filesHash = data.data.driveData.filesHash
|
||||
const filesHash = data.data.driveData.filesHash // Note: using versionID would cause chart packs to download multiple times
|
||||
if (this.currentDownload?.hash == filesHash || this.downloadQueue.isDownloadingLink(filesHash)) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import { emitIPCEvent } from '../../main'
|
||||
|
||||
export class DownloadQueue {
|
||||
|
||||
downloadQueue: ChartDownload[] = []
|
||||
private downloadQueue: ChartDownload[] = []
|
||||
|
||||
isDownloadingLink(filesHash: string) {
|
||||
return this.downloadQueue.some(download => download.hash == filesHash)
|
||||
|
||||
Reference in New Issue
Block a user