logo with bulk too

This commit is contained in:
dekzter 2025-04-03 16:12:55 -04:00
parent 7eae1e4ca5
commit 3aef6b4ea0

View file

@ -337,10 +337,15 @@ class ChannelViewSet(viewsets.ModelViewSet):
"name": name,
"tvg_id": stream.tvg_id,
"channel_group_id": channel_group.id,
"logo_url": stream.logo_url,
"streams": [stream_id],
}
if stream.logo_url:
logo, _ = Logo.objects.get_or_create(url=stream.logo_url, defaults={
"name": stream.name or stream.tvg_id
})
channel_data["logo_id"] = logo.id
# Attempt to find existing EPGs with the same tvg-id
epgs = EPGData.objects.filter(tvg_id=stream.tvg_id)
if epgs: