Browse Source

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.
adaptive-webui-19844
Chocobo1 2 years ago committed by GitHub
parent
commit
7397c80837
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/webui/www/private/scripts/mocha-init.js

4
src/webui/www/private/scripts/mocha-init.js

@ -1009,7 +1009,7 @@ const initializeWindows = function() {
for (const hash of hashes) { for (const hash of hashes) {
const row = torrentsTable.rows.get(hash); const row = torrentsTable.rows.get(hash);
if (!row) if (!row)
return; continue;
const name = row.full_data.name; const name = row.full_data.name;
const url = new URI("api/v2/torrents/export"); const url = new URI("api/v2/torrents/export");
@ -1018,7 +1018,7 @@ const initializeWindows = function() {
// download response to file // download response to file
const element = document.createElement("a"); const element = document.createElement("a");
element.setAttribute("href", url); element.setAttribute("href", url);
element.setAttribute("download", name + ".torrent"); element.setAttribute("download", (name + ".torrent"));
document.body.appendChild(element); document.body.appendChild(element);
element.click(); element.click();
document.body.removeChild(element); document.body.removeChild(element);

Loading…
Cancel
Save