mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-21 05:43:32 -07:00
WebUI: Switch from Object to Set
This commit is contained in:
parent
a325ef64bc
commit
e1b61afc1b
1 changed files with 5 additions and 5 deletions
|
@ -409,19 +409,19 @@ window.qBittorrent.TorrentContent ??= (() => {
|
||||||
fileIds.push(Number(torrentFilesTable.getRowFileId(rowId)));
|
fileIds.push(Number(torrentFilesTable.getRowFileId(rowId)));
|
||||||
});
|
});
|
||||||
|
|
||||||
const uniqueRowIds = {};
|
const uniqueRowIds = new Set();
|
||||||
const uniqueFileIds = {};
|
const uniqueFileIds = new Set();
|
||||||
for (let i = 0; i < rowIds.length; ++i) {
|
for (let i = 0; i < rowIds.length; ++i) {
|
||||||
const rows = getAllChildren(rowIds[i], fileIds[i]);
|
const rows = getAllChildren(rowIds[i], fileIds[i]);
|
||||||
rows.rowIds.forEach((rowId) => {
|
rows.rowIds.forEach((rowId) => {
|
||||||
uniqueRowIds[rowId] = true;
|
uniqueRowIds.add(rowId);
|
||||||
});
|
});
|
||||||
rows.fileIds.forEach((fileId) => {
|
rows.fileIds.forEach((fileId) => {
|
||||||
uniqueFileIds[fileId] = true;
|
uniqueFileIds.add(fileId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
setFilePriority(Object.keys(uniqueRowIds), Object.keys(uniqueFileIds), priority);
|
setFilePriority([...uniqueRowIds.keys()], [...uniqueFileIds.keys()], priority);
|
||||||
for (const id of rowIds)
|
for (const id of rowIds)
|
||||||
updateParentFolder(id);
|
updateParentFolder(id);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue