From d4e155e94999ab3b469ef6fbcdab0bc80491f9a9 Mon Sep 17 00:00:00 2001 From: dave Date: Sun, 29 Sep 2019 13:27:38 -0700 Subject: [PATCH] delete unstarted torrents function --- mediaweb/__init__.py | 5 +++++ templates/index.html | 3 +++ 2 files changed, 8 insertions(+) diff --git a/mediaweb/__init__.py b/mediaweb/__init__.py index 81361a8..957c7e7 100644 --- a/mediaweb/__init__.py +++ b/mediaweb/__init__.py @@ -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() diff --git a/templates/index.html b/templates/index.html index 0bba7ef..c8c7352 100644 --- a/templates/index.html +++ b/templates/index.html @@ -83,6 +83,9 @@ {% else %} {% endif %} + {% if tor.progress == 0 %} + + {% endif %}