epg models: add epg event id

This commit is contained in:
Nirvana
2026-09-05 21:17:03 +02:00
parent 9f5a684e26
commit 8ab709be77
2 changed files with 22 additions and 0 deletions
@@ -140,6 +140,23 @@ class EPGEntry:
program_id: Optional[str] = None
epg_event_id: Optional[str] = None
"""
Provider-native LISTING guid (e.g. "das_erste_hd_031eace5" for Magenta2) —
distinct from program_id, which holds the PROGRAM guid (e.g.
"telekom.de-031eace5"). These are two different identifiers on the
upstream API: the listing guid identifies a specific broadcast slot on a
specific channel/time, while the program guid identifies the underlying
content regardless of when/where it airs.
This is the identifier required to schedule an nPVR recording (passed to
the client as part of the EPG entry, cached client-side against
broadcast_id, and sent back as "epg_event_id" when the user creates a
timer for this broadcast). Populate it whenever the upstream provider
exposes a listing-level guid separate from the program guid; leave as
None for providers where no such distinction exists.
"""
# Optional fields - Program Information
description: Optional[str] = None
"""Full program description/plot. C++ expects 'description' key."""
@@ -613,6 +613,10 @@ class Magenta2EpgManager:
program: Dict[str, Any],
) -> Optional[EPGEntry]:
program_guid = program.get("guid", "")
# The listing's OWN guid - distinct from program_guid above. This is
# what the nPVR API needs to schedule a recording for this specific
# broadcast slot (see EPGEntry.epg_event_id docstring).
listing_guid = item.get("guid") or None
title = program.get("title", "Unknown")
broadcast_id = EPGEntry.encode_broadcast_id("magenta2", channel_id, start)
@@ -664,6 +668,7 @@ class Magenta2EpgManager:
start=start,
end=end,
program_id=program_guid,
epg_event_id=listing_guid,
description=description,
plot_outline=None,
episode_name=episode_name,