Added support for LIVE tag and dd_progrid numbering systems for epg.

This commit is contained in:
SergeantPanda 2025-06-03 22:00:17 -05:00
parent 722965b987
commit e7bf8cbede
2 changed files with 11 additions and 1 deletions

View file

@ -1634,6 +1634,9 @@ def extract_custom_properties(prog):
elif system == 'onscreen' and ep_num.text:
# Just store the raw onscreen format
custom_props['onscreen_episode'] = ep_num.text.strip()
elif system == 'dd_progid' and ep_num.text:
# Store the dd_progid format
custom_props['dd_progid'] = ep_num.text.strip()
# Extract ratings more efficiently
rating_elem = prog.find('rating')
@ -1669,7 +1672,7 @@ def extract_custom_properties(prog):
custom_props['icon'] = icon_elem.get('src')
# Simpler approach for boolean flags
for kw in ['previously-shown', 'premiere', 'new']:
for kw in ['previously-shown', 'premiere', 'new', 'live']:
if prog.find(kw) is not None:
custom_props[kw.replace('-', '_')] = True

View file

@ -314,6 +314,10 @@ def generate_epg(request, profile_name=None):
if 'onscreen_episode' in custom_data:
xml_lines.append(f' <episode-num system="onscreen">{html.escape(custom_data["onscreen_episode"])}</episode-num>')
# Handle dd_progid format
if 'dd_progid' in custom_data:
xml_lines.append(f' <episode-num system="dd_progid">{html.escape(custom_data["dd_progid"])}</episode-num>')
# Add season and episode numbers in xmltv_ns format if available
if 'season' in custom_data and 'episode' in custom_data:
season = int(custom_data['season']) - 1 if str(custom_data['season']).isdigit() else 0
@ -360,6 +364,9 @@ def generate_epg(request, profile_name=None):
if custom_data.get('new', False):
xml_lines.append(f' <new />')
if custom_data.get('live', False):
xml_lines.append(f' <live />')
except Exception as e:
xml_lines.append(f' <!-- Error parsing custom properties: {html.escape(str(e))} -->')