mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-11 20:14:13 +00:00
Add a file exists check to torrents passed as arg
This commit is contained in:
parent
095f4ff20a
commit
842734c4e4
@ -221,6 +221,10 @@ def process_args(args):
|
|||||||
else:
|
else:
|
||||||
# Just a file
|
# Just a file
|
||||||
log.debug("Attempting to add %s from external source..", arg)
|
log.debug("Attempting to add %s from external source..", arg)
|
||||||
|
if not os.path.exists(arg):
|
||||||
|
log.error("No such file: %s", arg)
|
||||||
|
continue
|
||||||
|
|
||||||
if config["interactive_add"]:
|
if config["interactive_add"]:
|
||||||
component.get("AddTorrentDialog").add_from_files([arg])
|
component.get("AddTorrentDialog").add_from_files([arg])
|
||||||
component.get("AddTorrentDialog").show(config["focus_add_dialog"])
|
component.get("AddTorrentDialog").show(config["focus_add_dialog"])
|
||||||
|
@ -192,6 +192,10 @@ class QueuedTorrents(component.Component):
|
|||||||
else:
|
else:
|
||||||
client.core.add_magnet_uris([torrent_path], [])
|
client.core.add_magnet_uris([torrent_path], [])
|
||||||
else:
|
else:
|
||||||
|
if not os.path.exists(torrent_path):
|
||||||
|
log.error("No such file: %s", torrent_path)
|
||||||
|
return
|
||||||
|
|
||||||
if self.config["interactive_add"]:
|
if self.config["interactive_add"]:
|
||||||
def on_show(result):
|
def on_show(result):
|
||||||
component.get("AddTorrentDialog").add_from_files([torrent_path])
|
component.get("AddTorrentDialog").add_from_files([torrent_path])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user