File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -287,6 +287,7 @@ <h1>QBT_TR(JavaScript Required! You must enable JavaScript for the WebUI to work
287287 < ul id ="torrentFilesMenu " class ="contextMenu ">
288288 < li > < a href ="#Rename "> < img src ="images/edit-rename.svg " alt ="QBT_TR(Rename...)QBT_TR[CONTEXT=PropertiesWidget] "> QBT_TR(Rename...)QBT_TR[CONTEXT=PropertiesWidget]</ a > </ li >
289289 < li > < a href ="#Download "> < img src ="images/download.svg " alt ="QBT_TR(Download)QBT_TR[CONTEXT=PropertiesWidget] "> QBT_TR(Download)QBT_TR[CONTEXT=PropertiesWidget]</ a > </ li >
290+ < li > < a href ="#CopyPath "> < img src ="images/edit-copy.svg " alt ="QBT_TR(Copy path)QBT_TR[CONTEXT=PropertiesWidget] "> QBT_TR(Copy path)QBT_TR[CONTEXT=PropertiesWidget]</ a > </ li >
290291 < li > < a href ="#CopyURL "> < img src ="images/edit-copy.svg " alt ="QBT_TR(Copy URL)QBT_TR[CONTEXT=PropertiesWidget] "> QBT_TR(Copy URL)QBT_TR[CONTEXT=PropertiesWidget]</ a > </ li >
291292 < li class ="separator ">
292293 < a href ="#FilePrio " class ="arrow-right "> < span style ="display: inline-block; width: 16px; "> </ span > QBT_TR(Priority)QBT_TR[CONTEXT=PropertiesWidget]</ a >
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ window.qBittorrent.Filesystem ??= (() => {
3535 const exports = ( ) => {
3636 return {
3737 PathSeparator : PathSeparator ,
38+ ServerPathSeparator : ServerPathSeparator ,
3839 fileExtension : fileExtension ,
3940 fileName : fileName ,
4041 folderName : folderName
@@ -43,6 +44,12 @@ window.qBittorrent.Filesystem ??= (() => {
4344
4445 const PathSeparator = "/" ;
4546
47+ /**
48+ * The native path separator used on the server
49+ */
50+ const ServerPathSeparator = ( window . qBittorrent ?. Cache . buildInfo . get ( ) . platform === "windows" )
51+ ? "\\" : PathSeparator ;
52+
4653 /**
4754 * Returns the file extension part of a file name.
4855 */
Original file line number Diff line number Diff line change @@ -469,6 +469,27 @@ window.qBittorrent.TorrentContent ??= (() => {
469469 const url = getSelectedFileUrl ( ) ;
470470 await window . qBittorrent . Misc . downloadFileStream ( url ) ;
471471 } ,
472+ CopyPath : async ( element , ref ) => {
473+ const torrentID = torrentsTable . getCurrentTorrentID ( ) ;
474+ const torrentRow = torrentsTable . getRow ( torrentID ) ;
475+ const savePath = torrentsTable . getRowData ( torrentRow , true ) . save_path ;
476+
477+ const files = [ ] ;
478+ for ( const rowID of torrentFilesTable . selectedRowsIds ( ) ) {
479+ const names = [ ] ;
480+ for ( let node = torrentFilesTable . getNode ( rowID ) ; ; node = node . parent ) {
481+ names . push ( node . name ) ;
482+ if ( node . depth <= 0 )
483+ break ;
484+ }
485+ names . push ( savePath ) ;
486+ names . reverse ( ) ;
487+
488+ files . push ( names . join ( window . qBittorrent . Filesystem . ServerPathSeparator ) ) ;
489+ }
490+
491+ await clipboardCopy ( files . join ( "\n" ) ) ;
492+ } ,
472493 CopyURL : async ( element , ref ) => {
473494 const url = getSelectedFileUrl ( ) ;
474495 await clipboardCopy ( url ) ;
You can’t perform that action at this time.
0 commit comments