Browse Source

xmltv: use channel number instead of xmltv_id

main
Brett Langdon 2 years ago
parent
commit
6287f2c025
No known key found for this signature in database GPG Key ID: 9BAD4322A65AD78B
2 changed files with 2 additions and 5 deletions
  1. +1
    -1
      src/dlhdhr/dlhd/channels.py
  2. +1
    -4
      src/dlhdhr/epg/program.py

+ 1
- 1
src/dlhdhr/dlhd/channels.py View File

@ -23,7 +23,7 @@ class DLHDChannel:
return f"/channel/{self.number}" return f"/channel/{self.number}"
def to_xmltv(self) -> Element: 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, "display-name", attrib={"lang": "en"}).text = self.name
SubElement(node, "lcn").text = self.number SubElement(node, "lcn").text = self.number
return node return node


+ 1
- 4
src/dlhdhr/epg/program.py View File

@ -26,13 +26,10 @@ class Program:
release_year: str | None release_year: str | None
def to_xmltv(self, channel: DLHDChannel) -> Element | 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") 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") 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: if self.title:
SubElement(programme, "title", attrib={"lang": "en"}).text = self.title SubElement(programme, "title", attrib={"lang": "en"}).text = self.title
if self.subtitle: if self.subtitle:


Loading…
Cancel
Save