1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-09 22:37:59 +00:00

Merge pull request #18853 from Chocobo1/exportTorrent

Work around Chrome download limit
This commit is contained in:
Chocobo1 2023-04-17 00:12:30 +08:00 committed by GitHub
commit 1fe006d16f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View File

@ -35,7 +35,7 @@
#include <QString>
#include <QtContainerFwd>
const int MAX_LOG_MESSAGES = 20000;
inline const int MAX_LOG_MESSAGES = 20000;
namespace Log
{

View File

@ -44,6 +44,7 @@ window.qBittorrent.Misc = (function() {
safeTrim: safeTrim,
toFixedPointString: toFixedPointString,
containsAllTerms: containsAllTerms,
sleep: sleep,
MAX_ETA: 8640000
};
};
@ -218,6 +219,12 @@ window.qBittorrent.Misc = (function() {
});
};
const sleep = (ms) => {
return new Promise((resolve) => {
setTimeout(resolve, ms);
});
};
return exports();
})();

View File

@ -1004,7 +1004,7 @@ const initializeWindows = function() {
return torrentsTable.selectedRowsIds().join("\n");
};
exportTorrentFN = function() {
exportTorrentFN = async function() {
const hashes = torrentsTable.selectedRowsIds();
for (const hash of hashes) {
const row = torrentsTable.rows.get(hash);
@ -1022,6 +1022,9 @@ const initializeWindows = function() {
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
// https://stackoverflow.com/questions/53560991/automatic-file-downloads-limited-to-10-files-on-chrome-browser
await window.qBittorrent.Misc.sleep(200);
}
};