mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-03 14:12:30 -06:00
@@ -174,6 +174,9 @@
|
||||
<li><a href="#" id="copyID" class="copyToClipboard"><img src="icons/edit-copy.svg" alt="QBT_TR(Torrent ID)QBT_TR[CONTEXT=TransferListWidget]" /> QBT_TR(Torrent ID)QBT_TR[CONTEXT=TransferListWidget]</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#exportTorrent"><img src="icons/edit-copy.svg" alt="QBT_TR(Export .torrent)QBT_TR[CONTEXT=TransferListWidget]" /> QBT_TR(Export .torrent)QBT_TR[CONTEXT=TransferListWidget]</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul id="categoriesFilterMenu" class="contextMenu">
|
||||
<li><a href="#createCategory"><img src="icons/list-add.svg" alt="QBT_TR(Add category...)QBT_TR[CONTEXT=CategoryFilterWidget]" /> QBT_TR(Add category...)QBT_TR[CONTEXT=CategoryFilterWidget]</a></li>
|
||||
|
||||
@@ -88,6 +88,7 @@ let copyInfohashFN = function(policy) {};
|
||||
let copyMagnetLinkFN = function() {};
|
||||
let copyIdFN = function() {};
|
||||
let setQueuePositionFN = function() {};
|
||||
let exportTorrentFN = function() {};
|
||||
|
||||
const initializeWindows = function() {
|
||||
saveWindowSize = function(windowId) {
|
||||
@@ -957,6 +958,26 @@ const initializeWindows = function() {
|
||||
return torrentsTable.selectedRowsIds().join("\n");
|
||||
};
|
||||
|
||||
exportTorrentFN = function() {
|
||||
const hashes = torrentsTable.selectedRowsIds();
|
||||
for (const hash of hashes) {
|
||||
const row = torrentsTable.rows.get(hash);
|
||||
if (!row) return
|
||||
|
||||
const name = row.full_data.name;
|
||||
const url = new URI("api/v2/torrents/export");
|
||||
url.setData("hash", hash);
|
||||
|
||||
// download response to file
|
||||
const element = document.createElement("a");
|
||||
element.setAttribute("href", url);
|
||||
element.setAttribute("download", name + ".torrent");
|
||||
document.body.appendChild(element);
|
||||
element.click();
|
||||
document.body.removeChild(element);
|
||||
}
|
||||
};
|
||||
|
||||
['pause', 'resume'].each(function(item) {
|
||||
addClickEvent(item + 'All', function(e) {
|
||||
new Event(e).stop();
|
||||
|
||||
@@ -97,6 +97,10 @@
|
||||
|
||||
superSeeding: function(element, ref) {
|
||||
setSuperSeedingFN(!ref.getItemChecked('superSeeding'));
|
||||
},
|
||||
|
||||
exportTorrent: function(element, ref) {
|
||||
exportTorrentFN();
|
||||
}
|
||||
},
|
||||
offsets: {
|
||||
|
||||
Reference in New Issue
Block a user