Reschedule download tasks when metadata is not ready

This commit is contained in:
tcely authored and GitHub committed 2025-03-17 11:43:00 -04:00
1 parent ac80c6ce67
commit 8eec7320db
1 file changed
+4
+4
View File
@@ -422,6 +422,8 @@ def download_media_thumbnail(media_id, url):
except Media.DoesNotExist:
# Task triggered but the media no longer exists, do nothing
return
if not media.has_metadata:
raise DownloadFailedException('Metadata is not yet available.')
if media.skip:
# Media was toggled to be skipped after the task was scheduled
log.warn(f'Download task triggered for media: {media} (UUID: {media.pk}) but '
@@ -459,6 +461,8 @@ def download_media(media_id):
except Media.DoesNotExist:
# Task triggered but the media no longer exists, do nothing
return
if not media.has_metadata:
raise DownloadFailedException('Metadata is not yet available.')
if media.skip:
# Media was toggled to be skipped after the task was scheduled
log.warn(f'Download task triggered for media: {media} (UUID: {media.pk}) but '