diff options
author | lonkaars <loek@pipeframe.xyz> | 2022-01-19 09:56:43 +0100 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2022-01-19 09:56:43 +0100 |
commit | 480b9b61d8066875b318afa14667ac7faa5c435a (patch) | |
tree | 2303592580a0db90af7da57f5407f5170dc3a881 | |
parent | e4f445edfe045a3e91d50cce29e6c560ea64544e (diff) |
don't link twice
-rwxr-xr-x | autonyaa.py | 6 |
1 files 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) |