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])
|
client.rpc.core.resume_torrent([thash])
|
||||||
elif action == "Pause":
|
elif action == "Pause":
|
||||||
client.rpc.core.pause_torrent([thash])
|
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:
|
else:
|
||||||
raise cherrypy.HTTPError(404)
|
raise cherrypy.HTTPError(404)
|
||||||
self.cache.refresh()
|
self.cache.refresh()
|
||||||
|
|
|
@ -83,6 +83,9 @@
|
||||||
{% else %}
|
{% else %}
|
||||||
<input name="action" type="submit" name="action" value="Pause" />
|
<input name="action" type="submit" name="action" value="Pause" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if tor.progress == 0 %}
|
||||||
|
<input name="action" type="submit" name="action" value="Delete" />
|
||||||
|
{% endif %}
|
||||||
</form>
|
</form>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
Loading…
Reference in New Issue