Browse Source

delete unstarted torrents function

master
dave 1 year ago
parent
commit
d4e155e949
2 changed files with 8 additions and 0 deletions
  1. +5
    -0
      mediaweb/__init__.py
  2. +3
    -0
      templates/index.html

+ 5
- 0
mediaweb/__init__.py View File

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


+ 3
- 0
templates/index.html View File

@@ -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…
Cancel
Save