Open ghost opened 4 years ago
Don't write the elements, if the data is null
in the API.
I checked the output in an XML beautifier. I actually use the date tag of XMLTV already and it should be working. I checked the XML output and if the JSON contains a year it is added properly. The corresponding line in the code can be found here --> https://github.com/achtnullzwei/A1TV_EPG/blob/be7e8293df1083d560fc01c834275e964423284e/api/functions.py#L69
I keep this one open. I like the idea including the country, however I think that requires a bit more work. :-)
Oh, I see, date is already used.
I've noticed, in the A1 API there are also dates likes "2020-"
(with trailing dash).
I'm not sure if this is an error in the API (truncated date), or they want to indicate an ongoing date.
There is no specific format in the XMLTV DTD and so this is not a formal error, but I'm not sure if clients accept such dates.
However, I saw, Tvheadend will not use date
(and also not country
) in the EPGDB by now (see also epg.h: struct epg_broadcast
).
So it's not a problem by now but there is also no need for the fields.
BTW: As the date is not filled always (there are empty date
tags in the XML), empty tags could also be omitted.
Since the description (desc
) will not be used in the XML data, it might be possible to use this element for other data, like date and country, but I'm not sure if this really a good idea...
The data in the A1 API typically include the country (countries) and a year. These values are currently not used, but it might be fine to have it also in the XML data.
There are proper elements in the XMLTV DTD which could be used:
country
anddate
. Note: There might me more than one country and they should be transformed (ALPHA-3 to ALPHA-2, ISO 3166-1). (For an easy solution it might be possible to use just the ALPHA-3 code(s), without splitting and transforming, but then also alang
attribute has to be used).