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, 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) 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..4e71f83a7 100644 --- a/src/webui/www/private/scripts/mocha-init.js +++ b/src/webui/www/private/scripts/mocha-init.js @@ -958,12 +958,12 @@ 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); if (!row) - return; + continue; const name = row.full_data.name; const url = new URI("api/v2/torrents/export"); @@ -972,10 +972,13 @@ 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); + + // https://stackoverflow.com/questions/53560991/automatic-file-downloads-limited-to-10-files-on-chrome-browser + await window.qBittorrent.Misc.sleep(200); } }; 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"; + }