autotorrent2
autotorrent2 copied to clipboard
If the folder already exists, just overwrite it
If the script errors out or there is some other issue and you re-run the script, you will most likely see Folder exists: 1 at the end of the the subsequent runs.
I know the folder exists already because there was an issue with the previous run, so just remove it and run the code again.
Here is the code I've written to just wipe out the dir if it exists so it will be recreated and things will continue normally and the torrent will be added
create_link_path() in utils.py
try:
store_path.mkdir(parents=True)
except FileExistsError:
#edits
shutil.rmtree(store_path)
store_path.mkdir(parents=True)
#raise FailedToCreateLinkException("Path already exist")
I can make an argument called something like --ignore-existing or something similar. Might also be smart to revert link folder when it fails.