Skip to content

Commit

Permalink
feat: error if download directory does not exist
Browse files Browse the repository at this point in the history
resolves: #4
  • Loading branch information
Xientraa committed May 8, 2023
1 parent bc5f420 commit 430ab73
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ def callback(url: TSRUrl):
runningDownloads: list[str] = []
downloadQueue: list[str] = []

if not os.path.exists(CONFIG["downloadDirectory"]):
errorMessage = f"The directory: {CONFIG['downloadDirectory']} does not exist! Please make sure the directory exists or the directory is set correctly in the config."
Logger.error(errorMessage, True)
raise FileNotFoundError(errorMessage)

session = None
sessionId = None
if os.path.exists(CURRENT_DIR + "/session"):
Expand Down

0 comments on commit 430ab73

Please sign in to comment.