Skip to content

Suggestion: Prompt & Handling magnet links #26

@thanosapollo

Description

@thanosapollo

Thank you for making this package.

Some changes I personally believe would improve the user experience:

Adding custom variables such as :

  • Default directory to look for .torrent files to add; transmission-torrents-dir
  • Default download directory; transmission-download-dir

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions