delete unstarted torrents function

This commit is contained in:
dave 2019-09-29 13:27:38 -07:00
parent 2099b337bc
commit d4e155e949
2 changed files with 8 additions and 0 deletions

View File

@ -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()

View File

@ -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>