A user can overwrite existing files when uploading.

This commit is contained in:
Roland 2025-02-03 17:16:13 -07:00
parent 3d6ccad0c0
commit fab3fd62ed
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
5 changed files with 114 additions and 9 deletions

View file

@ -95,7 +95,7 @@ async def singlefile_upload_switch_handler(singlefile):
Events.send_archive_uploaded(f'Created Archive from upload: {name}', url=archive.location)
url = archive.file_group.url
if url and (download := Download.get_by_url(url)):
if download.is_failed and download.downloader == ArchiveDownloader.name:
if (download.is_failed or download.is_deferred) and download.downloader == ArchiveDownloader.name:
# Download was attempted and failed, user manually archived the URL.
download_manager.delete_download(download.id)