mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-17 18:46:35 +00:00
Run the initial image downloads using huey
This commit is contained in:
parent
c144d9d55f
commit
6b4fa15ec6
@ -497,17 +497,15 @@ def index_source_task(source_id):
|
||||
log.info(f'Indexed new media: {source} / {media}')
|
||||
log.info(f'Scheduling tasks to download thumbnail for: {media.key}')
|
||||
thumbnail_fmt = 'https://i.ytimg.com/vi/{}/{}default.jpg'
|
||||
vn_fmt = _('Downloading {} thumbnail for: "{}": {}')
|
||||
for num, prefix in enumerate(('hq', 'sd', 'maxres',)):
|
||||
for num, prefix in enumerate(reversed(('hq', 'sd', 'maxres',))):
|
||||
thumbnail_url = thumbnail_fmt.format(
|
||||
media.key,
|
||||
prefix,
|
||||
)
|
||||
download_media_thumbnail(
|
||||
str(media.pk),
|
||||
thumbnail_url,
|
||||
schedule=dict(run_at=10+(300*num)),
|
||||
verbose_name=vn_fmt.format(prefix, media.key, media.name),
|
||||
download_media_image.schedule(
|
||||
(str(media.pk), thumbnail_url,),
|
||||
priority=10+(5*num),
|
||||
delay=65-(30*num),
|
||||
)
|
||||
log.info(f'Scheduling task to download metadata for: {media.url}')
|
||||
verbose_name = _('Downloading metadata for: "{}": {}')
|
||||
|
Loading…
Reference in New Issue
Block a user