Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion orpheus/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,4 +404,7 @@ def orpheus_core_download(orpheus_session: Orpheus, media_to_download, third_par
else:
raise Exception(f'\tUnknown media type "{mediatype}"')

if os.path.exists('temp'): shutil.rmtree('temp')
if os.path.isdir('temp') and not os.listdir('temp'): # Only if the temporary directory is empty
shutil.rmtree('temp') # Remove temporary directory
else:
print(f'=== The temporary folder is not empty ==={os.linesep}=== The temporary folder will not be deleted ==={os.linesep}=== Another instance of OrpheusDL is likely running ===')