Download again for missing media files

This commit is contained in:
tcely 2025-02-14 19:17:45 -05:00 committed by GitHub
parent 13bbeef5bf
commit 844b4b0493
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -453,7 +453,13 @@ def download_media(media_id):
log.warn(f'Download task triggered for media: {media} (UUID: {media.pk}) but '
f'it is now marked to be skipped, not downloading')
return
if media.downloaded and media.media_file and media.media_file.name:
downloaded_file_exists = (
media.media_file and
media.media_file.path and
media.filepath.samefile(media.media_file.path) and
media.filepath.exists()
)
if media.downloaded and downloaded_file_exists:
# Media has been marked as downloaded before the download_media task was fired,
# skip it
log.warn(f'Download task triggered for media: {media} (UUID: {media.pk}) but '