Download metadata before indexing another source

This commit is contained in:
tcely 2025-03-11 16:59:33 -04:00 committed by GitHub
parent 8cf2827e69
commit af0e300ef1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -234,6 +234,13 @@ def index_source_task(source_id):
)
if new_media_instance:
log.info(f'Indexed new media: {source} / {media}')
log.info(f'Scheduling task to download metadata for: {media.url}')
verbose_name = _('Downloading metadata for "{}"')
download_media_metadata(
str(media.pk),
priority=9,
verbose_name=verbose_name.format(media.pk),
)
except IntegrityError as e:
log.error(f'Index media failed: {source} / {media} with "{e}"')
# Tack on a cleanup of old completed tasks