Closed dagwieers closed 3 years ago
Another option is that we deprecate genre
and introduce genres
which is always a list.
# NOTE: Backward compatibility with earlier format
if item.get('genre'):
program += ' <category>{genre}</category>\n'.format(
genre=cls._xml_encode(item.get('genre')))
if item.get('genres') and isinstance(item.get('genres'), list):
for genre in item.get('genres'):
program += ' <category>{genre}</category>\n'.format(
genre=cls._xml_encode(genre))
I prefer to keep it at genre, so checking if it's a list does the trick.
This supports more than one genre in the XMLTV output.
VRT NU can have more than one category for a tv show episode or a movie.