Add 5.1 audio attribute support.

This commit is contained in:
Yuuki 2025-01-02 21:11:15 +09:00
parent ef97a070e6
commit 7642543796

View file

@ -30,11 +30,13 @@ class XMLTV:
open('data/channels.xml', mode='a', encoding='UTF-8').write(c)
def add_programme(self, channel, title, desc, start, stop, category, attr, icon):
# TODO: add `duo` attribute (bilingual)
programme = '<programme start="{} +0000" stop="{} +0000" channel="{}">'.format(start, stop, channel)
programme += '<title>{}</title>'.format(title)
programme += '<desc>{}</desc>'.format(desc)
programme += '<category lang="ja">{}</category>'.format(category)
if icon: programme += '<icon src="{}" />'.format(icon)
if '5.1' in attr: programme += '<audio><stereo>surround</stereo></audio>'
if 'stereo' in attr: programme += '<audio><stereo>stereo</stereo></audio>'
if 'mono' in attr: programme += '<audio><stereo>mono</stereo></audio>'
if 'hd' in attr: programme += '<video><present>yes</present><aspect>16:9</aspect><quality>HDTV</quality></video>'