mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-22 21:16:38 +00:00
Try to refresh formats while checking media
This commit is contained in:
parent
16cd0983c9
commit
ad8fa72123
@ -587,9 +587,24 @@ def save_all_media_for_source(source_id):
|
|||||||
log.error(f'Task save_all_media_for_source(pk={source_id}) called but no '
|
log.error(f'Task save_all_media_for_source(pk={source_id}) called but no '
|
||||||
f'source exists with ID: {source_id}')
|
f'source exists with ID: {source_id}')
|
||||||
return
|
return
|
||||||
|
|
||||||
|
already_saved = set()
|
||||||
|
mqs = Media.objects.filter(source=source)
|
||||||
|
refresh_qs = mqs.filter(
|
||||||
|
can_download=False,
|
||||||
|
skip=False,
|
||||||
|
manual_skip=False,
|
||||||
|
downloaded=False,
|
||||||
|
)
|
||||||
|
for media in refresh_qs:
|
||||||
|
media.refresh_formats
|
||||||
|
media.save()
|
||||||
|
already_saved.add(media.uuid)
|
||||||
|
|
||||||
# Trigger the post_save signal for each media item linked to this source as various
|
# Trigger the post_save signal for each media item linked to this source as various
|
||||||
# flags may need to be recalculated
|
# flags may need to be recalculated
|
||||||
for media in Media.objects.filter(source=source):
|
for media in mqs:
|
||||||
|
if media.uuid not in already_saved:
|
||||||
media.save()
|
media.save()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user