From 480b9b61d8066875b318afa14667ac7faa5c435a Mon Sep 17 00:00:00 2001 From: lonkaars Date: Wed, 19 Jan 2022 09:56:43 +0100 Subject: don't link twice --- autonyaa.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autonyaa.py b/autonyaa.py index 23ad5d1..841106a 100755 --- a/autonyaa.py +++ b/autonyaa.py @@ -101,10 +101,10 @@ def start_dl(result, section, vars): torrent = [t for t in torrents if t.hashString == hash] if len(torrent) == 1: torrent = torrent[0] - if torrent.progress == 100: + source = torrent.download_dir + "/" + torrent.files()[0].name + target = section["destination"] + "/" + section["filename"](vars) + if torrent.progress == 100 and not os.path.exists(target): print("linking " + section["name"]) - source = torrent.download_dir + "/" + torrent.files()[0].name - target = section["destination"] + "/" + section["filename"](vars) print(source + " -> " + target) os.makedirs(os.path.dirname(target), exist_ok=True) os.link(source, target) -- cgit v1.2.3