killemov / Shift

A minimalistic approach to maximum control of your Transmission. (Web UI)
https://forum.transmissionbt.com/viewtopic.php?f=8&t=12555
260 stars 20 forks source link

fileLink template support #26

Closed InsideTheVoid closed 5 months ago

InsideTheVoid commented 5 months ago

The fileLink feature works great if you only use 1 downloadDir. If you use multiple, it would be great if you could do something like:

{
    "fileLink": "https://example.com/{torrent.downloadDir}",
}

In this setup files could be accessed with:

/storageA/torrent1/file.txt --> https://example.com/storageA/torrent1/file.txt /storageA/torrent2/file.txt --> https://example.com/storageA/torrent2/file.txt /storageB/torrent3/file.txt --> https://example.com/storageB/torrent3/file.txt

Is this something you would be willing to implement?

killemov commented 5 months ago

Is this something you would be willing to implement?

I already have implemented this. It was going to be in the next release, but I will see if I can separate it for you now-ish.

killemov commented 5 months ago

@InsideTheVoid Please test and post your feedback here. And if you like it, put a on it.

InsideTheVoid commented 5 months ago

Thank you very much for the quick fix.

fileLink works as expected, but folderLink doesn't replace the variable and just outputs ${torrent.downloadDir} as plain text.

The example of /secret/${torrent.downloadDir}/ leads to a link with double slashes e.g. /secret//folder// so I used /secret${torrent.downloadDir}.

killemov commented 5 months ago

I missed the folder link while separating and then I figured I could reduce some code by integrating stuff into String.

InsideTheVoid commented 5 months ago

Works like a charm. Thank you; I appreciate it very much.