I'm using those var names as an example for reference
Changing transmission-add in the following ways
Detect magnet links from clipboard & add them as an option to the directory-files of transmission-torrents-dir
Current prompt implementation works nicely with packages like ivy, but without ivy or with packages like vertico, there is no way as far as I know to select the magnet link
From a quick look at transmission.el maybe something like this would be useful:
(defun transmission-add--prompt ()
"Add magnet link from clipboard or prompt for torrent file."
(let ((clipboard (gui-get-selection 'CLIPBOARD)))
(if (and (>= (length clipboard) 6)
(string-equal "magnet" (substring-no-properties clipboard 0 6)))
(completing-read
"Add torrent: "
(cons clipboard (directory-files transmission-torrents-dir t "\\.torrent$")))
(read-file-name "Add torrent: " transmission-torrents-dir))))
Something like the scratch function above could be used as the input of transmission-add, simplifying it's current implementation as well.
Thank you for making this package.
Some changes I personally believe would improve the user experience:
Adding custom variables such as :
.torrent
files to add;transmission-torrents-dir
transmission-download-dir
I'm using those var names as an example for reference
Changing
transmission-add
in the following waysdirectory-files
oftransmission-torrents-dir
From a quick look at transmission.el maybe something like this would be useful:
Something like the scratch function above could be used as the
input
oftransmission-add
, simplifying it's current implementation as well.