PDA

Bekijk de volledige versie : transsmission.cgi - addon snippet



Pettt[cz]
01-07-2007, 23:16
Do you keep getting "Can only remove suspended torrents!"
Do you need to get rid of DONE torrents, and you dont know how or you dont want to do that from the TERMINAL window with the clasic UNIX shell commands.

This is how to modify your transsmision.cgi to get aditional button/Funciton called ForceRemove. That will remove marked torrent, directory and all filesin it. Use with caution!

Find the correct section in transmission.cgi and add only red lines:

----------------------------------------
<input type=submit accesskey=h name=ACTION value=Help>
<input type=submit accesskey=h name=FORCEREM value=ForceRemove onClick='value=confirm("Torrent and all files will be deleted! Are you sure?")'>
<! img align=top alt="" src=pingvin.gif>


[ -n "${FETCH}" ] && _fetch
[ -n "${FORCEREM}" ] && _forceremove
case "${ACTION}" in


_info ()
{
if [ -z "$ID" ] ; then
echo "<b>Please select torrent first!</b>"
return
fi
_find
echo "<h3>Torrent file metainfo</h3>"
echo "<pre>"
transmissioncli -i "${TORRENT}"
echo "<p>"
transmissioncli -s "${TORRENT}" | grep "seeder"
echo "</p></pre>"
}

_forceremove ()
{
if [ false = "$FORCEREM" ] ; then
return
fi

if [ -z "$ID" ] ; then
echo "<b>Please select torrent first!</b>"
return
fi

_find

rm -rf dirname "$TORRENT"
echo "<br>"
}
----------------------------------------

NOTES:
- full cgi in attachment
- path to cgi within router "\harddisk\share\www\cgi-bin"
- samba by default will not let you save at that location. Modify from any unix shell util.

DISCLAIMER:
This is just one lame windows user trying to help others with something I've been missing in the transsmission UI. Deep bow and gloory to all you real pros and developers...

Stuckish
10-09-2007, 19:34
Thank you!

oleo
10-09-2007, 22:00
It would be nicer if you rewrite this to be configurable option to /opt/etc/transmission.conf

I've done this feature with transmission-0.82 . Just enable

# Enable removing of DONE non-seeding torrents in ${TARGET} directory
FORCE_REMOVE="yes"
in transmission.conf
and use Remove button.