diff --git a/src/dlhdhr/dlhd/channels.py b/src/dlhdhr/dlhd/channels.py index 7fb8416..169d9fe 100644 --- a/src/dlhdhr/dlhd/channels.py +++ b/src/dlhdhr/dlhd/channels.py @@ -23,7 +23,7 @@ class DLHDChannel: return f"/channel/{self.number}" def to_xmltv(self) -> Element: - node = Element("channel", attrib={"id": self.xmltv_id}) + node = Element("channel", attrib={"id": str(self.number)}) SubElement(node, "display-name", attrib={"lang": "en"}).text = self.name SubElement(node, "lcn").text = self.number return node diff --git a/src/dlhdhr/epg/program.py b/src/dlhdhr/epg/program.py index a60e831..c221fde 100644 --- a/src/dlhdhr/epg/program.py +++ b/src/dlhdhr/epg/program.py @@ -26,13 +26,10 @@ class Program: release_year: str | None def to_xmltv(self, channel: DLHDChannel) -> Element | None: - if not channel.xmltv_id: - return None - start_time = self.start_time.strftime("%Y%m%d%H%M%S %z") end_time = self.start_time.strftime("%Y%m%d%H%M%S %z") - programme = Element("programme", attrib={"start": start_time, "stop": end_time, "channel": channel.xmltv_id}) + programme = Element("programme", attrib={"start": start_time, "stop": end_time, "channel": str(channel.number)}) if self.title: SubElement(programme, "title", attrib={"lang": "en"}).text = self.title if self.subtitle: