Skip to content

Commit d1776df

Browse files
authored
Merge pull request #1219 from tcely/patch-6
Use `download_source_images` after editing a `Source`
2 parents 0f34813 + 267adb7 commit d1776df

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tubesync/sync/signals.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
@receiver(pre_save, sender=Source)
3333
def source_pre_save(sender, instance, **kwargs):
34+
source = instance # noqa: F841
3435
# Triggered before a source is saved, if the schedule has been updated recreate
3536
# its indexing task
3637
try:
@@ -41,6 +42,10 @@ def source_pre_save(sender, instance, **kwargs):
4142

4243
args = ( str(instance.pk), )
4344
check_source_directory_exists.call_local(*args)
45+
existing_copy_channel_images = existing_source.copy_channel_images
46+
new_copy_channel_images = instance.copy_channel_images
47+
if new_copy_channel_images and not (existing_copy_channel_images or instance.is_playlist):
48+
download_source_images(str(instance.pk))
4449
existing_dirpath = existing_source.directory_path.resolve(strict=True)
4550
new_dirpath = instance.directory_path.resolve(strict=False)
4651
if existing_dirpath != new_dirpath:

0 commit comments

Comments
 (0)