include movie date in xmltv (#70)

This commit is contained in:
Jason Dove
2021-03-13 03:20:39 +00:00
committed by GitHub
parent b3f4c22f49
commit 0da9701f9c
+6 -1
View File
@@ -97,12 +97,17 @@ namespace ErsatzTV.Core.Iptv
xml.WriteAttributeString("stop", stop);
xml.WriteAttributeString("channel", channel.Number);
if (playoutItem.MediaItem is Movie)
if (playoutItem.MediaItem is Movie movie)
{
xml.WriteStartElement("category");
xml.WriteAttributeString("lang", "en");
xml.WriteString("Movie");
xml.WriteEndElement(); // category
int year = movie.MovieMetadata.HeadOrNone().Match(mm => mm.Year ?? 0, () => 0);
xml.WriteStartElement("date");
xml.WriteString(year.ToString());
xml.WriteEndElement(); // date
}
xml.WriteStartElement("title");