mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-18 02:56:36 +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'Indexed new media: {source} / {media}')
|
||||||
log.info(f'Scheduling tasks to download thumbnail for: {media.key}')
|
log.info(f'Scheduling tasks to download thumbnail for: {media.key}')
|
||||||
thumbnail_fmt = 'https://i.ytimg.com/vi/{}/{}default.jpg'
|
thumbnail_fmt = 'https://i.ytimg.com/vi/{}/{}default.jpg'
|
||||||
vn_fmt = _('Downloading {} thumbnail for: "{}": {}')
|
for num, prefix in enumerate(reversed(('hq', 'sd', 'maxres',))):
|
||||||
for num, prefix in enumerate(('hq', 'sd', 'maxres',)):
|
|
||||||
thumbnail_url = thumbnail_fmt.format(
|
thumbnail_url = thumbnail_fmt.format(
|
||||||
media.key,
|
media.key,
|
||||||
prefix,
|
prefix,
|
||||||
)
|
)
|
||||||
download_media_thumbnail(
|
download_media_image.schedule(
|
||||||
str(media.pk),
|
(str(media.pk), thumbnail_url,),
|
||||||
thumbnail_url,
|
priority=10+(5*num),
|
||||||
schedule=dict(run_at=10+(300*num)),
|
delay=65-(30*num),
|
||||||
verbose_name=vn_fmt.format(prefix, media.key, media.name),
|
|
||||||
)
|
)
|
||||||
log.info(f'Scheduling task to download metadata for: {media.url}')
|
log.info(f'Scheduling task to download metadata for: {media.url}')
|
||||||
verbose_name = _('Downloading metadata for: "{}": {}')
|
verbose_name = _('Downloading metadata for: "{}": {}')
|
||||||
|
Loading…
Reference in New Issue
Block a user