delete unstarted torrents function
This commit is contained in:
parent
2099b337bc
commit
d4e155e949
|
@ -278,6 +278,11 @@ class MediaWeb(object):
|
|||
client.rpc.core.resume_torrent([thash])
|
||||
elif action == "Pause":
|
||||
client.rpc.core.pause_torrent([thash])
|
||||
elif action == "Delete":
|
||||
if self.cache.torrents[tkey]["progress"] > 0:
|
||||
raise Exception("Cowardly refusing to delete a torrent with progress > 0")
|
||||
else:
|
||||
client.rpc.core.remove_torrent(thash, True)
|
||||
else:
|
||||
raise cherrypy.HTTPError(404)
|
||||
self.cache.refresh()
|
||||
|
|
|
@ -83,6 +83,9 @@
|
|||
{% else %}
|
||||
<input name="action" type="submit" name="action" value="Pause" />
|
||||
{% endif %}
|
||||
{% if tor.progress == 0 %}
|
||||
<input name="action" type="submit" name="action" value="Delete" />
|
||||
{% endif %}
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
Loading…
Reference in New Issue