Duplicate banner.jpg to background.jpg

This commit is contained in:
administrator 2023-12-11 19:38:36 +01:00
parent 0478cb399e
commit 32a884365b
3 changed files with 11 additions and 10 deletions

View File

@ -13,6 +13,6 @@ class Migration(migrations.Migration):
migrations.AddField( migrations.AddField(
model_name='source', model_name='source',
name='copy_channel_images', name='copy_channel_images',
field=models.BooleanField(default=False, help_text='Copy channel images : banner as banner.jpg and avatar as poster.jpg and season-poster.jpg. These may be detected and used by some media servers', verbose_name='copy channel images'), field=models.BooleanField(default=False, help_text='Copy channel banner and avatar. These may be detected and used by some media servers', verbose_name='copy channel images'),
), ),
] ]

View File

@ -346,7 +346,7 @@ class Source(models.Model):
copy_channel_images = models.BooleanField( copy_channel_images = models.BooleanField(
_('copy channel images'), _('copy channel images'),
default=False, default=False,
help_text=_('Copy channel images : banner as banner.jpg and avatar as poster.jpg and season-poster.jpg. These may be detected and used by some media servers') help_text=_('Copy channel banner and avatar. These may be detected and used by some media servers')
) )
copy_thumbnails = models.BooleanField( copy_thumbnails = models.BooleanField(
_('copy thumbnails'), _('copy thumbnails'),

View File

@ -242,7 +242,8 @@ def download_source_images(source_id):
i = get_remote_image(url) i = get_remote_image(url)
image_file = BytesIO() image_file = BytesIO()
i.save(image_file, 'JPEG', quality=85, optimize=True, progressive=True) i.save(image_file, 'JPEG', quality=85, optimize=True, progressive=True)
file_name = "banner.jpg"
for file_name in ["banner.jpg", "background.jpg"]:
# Reset file pointer to the beginning for the next save # Reset file pointer to the beginning for the next save
image_file.seek(0) image_file.seek(0)
# Create a Django ContentFile from BytesIO stream # Create a Django ContentFile from BytesIO stream