From 5cae2e595e9cea37a1326d465bdc5f5013b33b30 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Wed, 21 May 2025 12:52:30 -0500 Subject: [PATCH] Add tvc-guide-id (gracenote ID) to channel when using bulk creation. --- apps/channels/api_views.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/channels/api_views.py b/apps/channels/api_views.py index bbcbf686..890dd247 100644 --- a/apps/channels/api_views.py +++ b/apps/channels/api_views.py @@ -427,6 +427,10 @@ class ChannelViewSet(viewsets.ModelViewSet): channel_number = float(stream_custom_props['tvg-chno']) elif 'channel-number' in stream_custom_props: channel_number = float(stream_custom_props['channel-number']) + # Get the tvc_guide_stationid from custom properties if it exists + tvc_guide_stationid = None + if 'tvc-guide-stationid' in stream_custom_props: + tvc_guide_stationid = stream_custom_props['tvc-guide-stationid'] # Determine channel number: if provided, use it (if free); else auto assign. if channel_number is None: @@ -447,6 +451,7 @@ class ChannelViewSet(viewsets.ModelViewSet): channel_data = { "channel_number": channel_number, "name": name, + 'tvc_guide_stationid': tvc_guide_stationid, "tvg_id": stream.tvg_id, "channel_group_id": channel_group.id, }