mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-22 21:16:38 +00:00
Merge pull request #856 from tcely/patch-12
Reschedule download tasks when metadata is not ready
This commit is contained in:
commit
58c4964939
@ -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 '
|
||||
|
Loading…
Reference in New Issue
Block a user