mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 06:28:03 -06:00
Allow to copy content paths of selected torrents
Closes #23227. PR #23239. --------- Co-authored-by: Chocobo1 <Chocobo1@users.noreply.github.com>
This commit is contained in:
@@ -219,6 +219,7 @@
|
||||
<li><a href="#" id="copyMagnetLink" class="copyToClipboard"><img src="images/torrent-magnet.svg" alt="QBT_TR(Magnet link)QBT_TR[CONTEXT=TransferListWidget]"> QBT_TR(Magnet link)QBT_TR[CONTEXT=TransferListWidget]</a></li>
|
||||
<li><a href="#" id="copyID" class="copyToClipboard"><img src="images/help-about.svg" alt="QBT_TR(Torrent ID)QBT_TR[CONTEXT=TransferListWidget]"> QBT_TR(Torrent ID)QBT_TR[CONTEXT=TransferListWidget]</a></li>
|
||||
<li><a href="#" id="copyComment" class="copyToClipboard"><img src="images/edit-copy.svg" alt="QBT_TR(Comment)QBT_TR[CONTEXT=TransferListWidget]"> QBT_TR(Comment)QBT_TR[CONTEXT=TransferListWidget]</a></li>
|
||||
<li><a href="#" id="copyContentPath" class="copyToClipboard"><img src="images/directory.svg" alt="QBT_TR(Content Path)QBT_TR[CONTEXT=TransferListWidget]"> QBT_TR(Content Path)QBT_TR[CONTEXT=TransferListWidget]</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
|
||||
@@ -1886,6 +1886,9 @@ window.addEventListener("DOMContentLoaded", (event) => {
|
||||
case "copyComment":
|
||||
setupClickEvent(copyCommentFN);
|
||||
break;
|
||||
case "copyContentPath":
|
||||
setupClickEvent(copyContentPathFN);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -153,6 +153,7 @@ let copyInfohashFN = (policy) => {};
|
||||
let copyMagnetLinkFN = () => {};
|
||||
let copyIdFN = () => {};
|
||||
let copyCommentFN = () => {};
|
||||
let copyContentPathFN = () => {};
|
||||
let setQueuePositionFN = () => {};
|
||||
let exportTorrentFN = () => {};
|
||||
|
||||
@@ -1219,6 +1220,20 @@ const initializeWindows = () => {
|
||||
return comments.join("\n---------\n");
|
||||
};
|
||||
|
||||
copyContentPathFN = () => {
|
||||
const selectedRows = torrentsTable.selectedRowsIds();
|
||||
const contentPaths = [];
|
||||
if (selectedRows.length > 0) {
|
||||
const rows = torrentsTable.getFilteredAndSortedRows();
|
||||
for (const hash of selectedRows) {
|
||||
const contentPath = rows[hash].full_data.content_path;
|
||||
if ((contentPath !== null) && (contentPath.length > 0))
|
||||
contentPaths.push(contentPath);
|
||||
}
|
||||
}
|
||||
return contentPaths.join("\n");
|
||||
};
|
||||
|
||||
exportTorrentFN = async () => {
|
||||
const hashes = torrentsTable.selectedRowsIds();
|
||||
for (const hash of hashes) {
|
||||
|
||||
Reference in New Issue
Block a user