From 2b4fcda4639ac04e5ba68bae134beef17b654882 Mon Sep 17 00:00:00 2001 From: Vladimir Golovnev Date: Thu, 13 Apr 2023 06:22:18 +0300 Subject: [PATCH 1/5] Disable UPnP for web UI by default PR #18832. --- src/base/preferences.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/base/preferences.cpp b/src/base/preferences.cpp index 101eefd77..9946c9116 100644 --- a/src/base/preferences.cpp +++ b/src/base/preferences.cpp @@ -599,11 +599,7 @@ void Preferences::setWebUiPort(const quint16 port) bool Preferences::useUPnPForWebUIPort() const { -#ifdef DISABLE_GUI - return value(u"Preferences/WebUI/UseUPnP"_qs, true); -#else return value(u"Preferences/WebUI/UseUPnP"_qs, false); -#endif } void Preferences::setUPnPForWebUIPort(const bool enabled) From 9d42657468e02613e80e11c70d62868ed45d40eb Mon Sep 17 00:00:00 2001 From: Vladimir Golovnev Date: Thu, 13 Apr 2023 06:18:09 +0300 Subject: [PATCH 2/5] Don't miss saving "download path" in SQLite storage PR #18844. Closes #18842. --- src/base/bittorrent/dbresumedatastorage.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/base/bittorrent/dbresumedatastorage.cpp b/src/base/bittorrent/dbresumedatastorage.cpp index 73f80e4da..5dec4d7a6 100644 --- a/src/base/bittorrent/dbresumedatastorage.cpp +++ b/src/base/bittorrent/dbresumedatastorage.cpp @@ -627,6 +627,7 @@ void BitTorrent::DBResumeDataStorage::Worker::store(const TorrentID &id, const L DB_COLUMN_CATEGORY, DB_COLUMN_TAGS, DB_COLUMN_TARGET_SAVE_PATH, + DB_COLUMN_DOWNLOAD_PATH, DB_COLUMN_CONTENT_LAYOUT, DB_COLUMN_RATIO_LIMIT, DB_COLUMN_SEEDING_TIME_LIMIT, From e246745776355bd90e3bb6cc236402f9f56bef48 Mon Sep 17 00:00:00 2001 From: DivineHawk Date: Sun, 16 Apr 2023 13:30:30 +0200 Subject: [PATCH 3/5] WebUI: Use workaround for IOS file picker PR #18837. Fixes #18683. --- src/webui/www/private/upload.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/webui/www/private/upload.html b/src/webui/www/private/upload.html index 1a0974356..61b094c42 100644 --- a/src/webui/www/private/upload.html +++ b/src/webui/www/private/upload.html @@ -158,6 +158,10 @@ if (submitted) window.parent.closeWindows(); }); + + if (Browser.platform === 'ios') { + $('fileselect').accept = ".torrent"; + }
From 8de091f4dd7eec7a79788fe1c6d1c323e8592774 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sat, 15 Apr 2023 14:51:27 +0800 Subject: [PATCH 4/5] Work around Chrome download limit Closes #18775. --- src/webui/www/private/scripts/misc.js | 7 +++++++ src/webui/www/private/scripts/mocha-init.js | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/webui/www/private/scripts/misc.js b/src/webui/www/private/scripts/misc.js index 0c5685f0c..618d6fec1 100644 --- a/src/webui/www/private/scripts/misc.js +++ b/src/webui/www/private/scripts/misc.js @@ -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(); })(); diff --git a/src/webui/www/private/scripts/mocha-init.js b/src/webui/www/private/scripts/mocha-init.js index 87748bf85..d07c10519 100644 --- a/src/webui/www/private/scripts/mocha-init.js +++ b/src/webui/www/private/scripts/mocha-init.js @@ -958,7 +958,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); @@ -976,6 +976,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); } }; From c509f57b66a411e97f007ebd45a85dd660364d94 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Tue, 18 Apr 2023 13:59:55 +0800 Subject: [PATCH 5/5] WebUI: improve 'exporting torrent' behavior Don't stop the whole operation when a torrent doesn't exists and try to export the remaining existing ones. PR #18858. --- src/webui/www/private/scripts/mocha-init.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/webui/www/private/scripts/mocha-init.js b/src/webui/www/private/scripts/mocha-init.js index d07c10519..4e71f83a7 100644 --- a/src/webui/www/private/scripts/mocha-init.js +++ b/src/webui/www/private/scripts/mocha-init.js @@ -963,7 +963,7 @@ const initializeWindows = function() { for (const hash of hashes) { const row = torrentsTable.rows.get(hash); if (!row) - return; + continue; const name = row.full_data.name; const url = new URI("api/v2/torrents/export"); @@ -972,7 +972,7 @@ const initializeWindows = function() { // download response to file const element = document.createElement("a"); element.setAttribute("href", url); - element.setAttribute("download", name + ".torrent"); + element.setAttribute("download", (name + ".torrent")); document.body.appendChild(element); element.click(); document.body.removeChild(element);