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:
Mark Yu
2025-09-14 04:42:59 -04:00
committed by GitHub
parent 919520b4c3
commit 8e14541236
5 changed files with 36 additions and 0 deletions

View File

@@ -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) {