Fix issues adding magnet uris
This commit is contained in:
parent
aa86aa6fe1
commit
634ecdeb1d
|
@ -226,7 +226,11 @@ class AddTorrentDialog(component.Component):
|
|||
new_row = None
|
||||
|
||||
for uri in uris:
|
||||
info_hash = base64.b32decode(uri.split("&")[0][20:]).encode("hex")
|
||||
s = uri.split("&")[0][20:]
|
||||
if len(s) == 32:
|
||||
info_hash = base64.b32decode(s).encode("hex")
|
||||
elif len(s) == 40:
|
||||
info_hash = s
|
||||
if info_hash in self.infos:
|
||||
log.debug("Torrent already in list!")
|
||||
continue
|
||||
|
|
|
@ -71,7 +71,9 @@ class IPCInterface(component.Component):
|
|||
_args = []
|
||||
for arg in args:
|
||||
if arg.strip():
|
||||
_args.append(os.path.abspath(arg))
|
||||
if not deluge.common.is_magnet(arg) and not deluge.common.is_url(arg):
|
||||
arg = os.path.abspath(arg)
|
||||
_args.append(arg)
|
||||
args = _args
|
||||
|
||||
socket = os.path.join(deluge.configmanager.get_config_dir("ipc"), "deluge-gtk")
|
||||
|
|
Loading…
Reference in New Issue