Skip to content

Commit

Permalink
support programme urls
Browse files Browse the repository at this point in the history
  • Loading branch information
eddami committed Oct 4, 2023
1 parent 9a775da commit c947fdc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/XmlTvSharp/XmlTvProgramme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class XmlTvProgramme : IXmlTvElement
public Dictionary<string, string> Titles { get; set; } = new();
public Dictionary<string, string>? SubTitles { get; set; }
public Dictionary<string, string>? Descriptions { get; set; }
public List<XmlTvUrl>? Urls { get; set; }
public List<string>? Actors { get; set; }
public DateTimeOffset? Date { get; set; }
public bool IsPreviouslyShown { get; set; }
Expand Down
6 changes: 6 additions & 0 deletions src/XmlTvSharp/XmlTvReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,12 @@ private static async Task HandleTitleElement(XmlReader reader, ParsingContext co
context.Programme.Icons.Add(icon);
}

break;
case "url" when !reader.IsEmptyElement:
var url = await ReadUrlElement(reader);
context.Programme!.Urls ??= new List<XmlTvUrl>();
context.Programme.Urls.Add(url);

break;
}
}
Expand Down

0 comments on commit c947fdc

Please sign in to comment.