Opened 8 years ago
Last modified 7 years ago
#5770 new Enhancement
Add Magnetlink to available environment variables
Reported by: | basecase | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | None Set |
Component: | Transmission | Version: | 2.84 |
Severity: | Normal | Keywords: | scripts |
Cc: |
Description
This should be an easy one. Add the magnetlink of a completed torrent to the available variables for post-completion scripts. The option is already there in the context menu. Ideally, I would modify the context menu entry to simple copy a text file into the torrent directory with the magnetlink. Say the magnet link in a flat [NameofTorrent?].magnetlink file. This would allow for better reseeding. In an automated fashion
Attachments (4)
Change History (7)
Changed 7 years ago by basecase
comment:1 Changed 7 years ago by basecase
I have a rough patch for the libtransmission files: transmission.h, torrent-magnet.h, and torrent-magnet.c
The patch uses the exiting menu option to copy magnet link to clip board but also copies magnet link to a file with the same name as the torrent. The file is created in the torrents download folder. What do you guys think, I want to just have a separate option to copy magnet link to file in the menu but i think this would work be better as a plugin of some sort, as not to crowd the menu.
comment:2 Changed 7 years ago by basecase
So I did this the easy way and just made the magnetLINK an environment variable. Patch attached.
## To add the Magnetlink to environment variables
add this line
## tr_strdup_printf ("TR_TORRENT_MAGNETLINK=%s", tr_tr_torrentGetMagnetLink(tor)),
to the torrent.c file in libtransmission line 2117
comment:3 Changed 7 years ago by basecase
Well, if the patch is not accepted then one can get the same functionality from this line:
magnetLINK=$(transmission-remote -t $TR_TORRENT_ID -i | grep "Magnet:" | sed -r 's/^.{10}//')
Modified Transmission.h