only finalize when completed

pull/233/head
Stable Diffusion Daemon 2023-08-05 22:21:05 +09:00
parent 920ca3267f
commit 76128e7339
1 changed files with 6 additions and 4 deletions

View File

@ -108,8 +108,10 @@ def dl(url, folder, filename, filepath):
print()
# rename file
os.rename(dl_file_path, file_path)
util.printD(f"File Downloaded to: {file_path}")
return file_path
if downloaded_size == total_size:
# rename file
os.rename(dl_file_path, file_path)
util.printD(f"File Downloaded to: {file_path}")
return file_path
return