Skip to content

Commit

Permalink
propagate live flag
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm1 committed Jul 30, 2022
1 parent 7a8266c commit b3e7c1e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/xmltv/xmltv.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ type Programme struct {
Premiere *CommonElement `xml:"premiere,omitempty" json:"premiere,omitempty"`
LastChance *CommonElement `xml:"last-chance,omitempty" json:"last_chance,omitempty"`
New *ElementPresent `xml:"new" json:"new,omitempty"`
Live *ElementPresent `xml:"live" json:"live,omitempty"`
Subtitles []Subtitle `xml:"subtitles,omitempty" json:"subtitles,omitempty"`
Ratings []Rating `xml:"rating,omitempty" json:"ratings,omitempty"`
StarRatings []Rating `xml:"star-rating,omitempty" json:"star_ratings,omitempty"`
Expand Down
6 changes: 6 additions & 0 deletions structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,18 @@ type Program struct {
func (p *Program) XMLTV() xmltv.Programme {
start := xmltv.Time(p.Start)
stop := xmltv.Time(p.Stop)
var live *xmltv.ElementPresent
if p.IsLive {
tmp := xmltv.ElementPresent(p.IsLive)
live = &tmp
}
return xmltv.Programme{
Titles: []xmltv.CommonElement{p.Title},
Descriptions: []xmltv.CommonElement{p.Description},
Categories: p.Categories,
Start: &start,
Stop: &stop,
Live: live,
Channel: fmt.Sprintf("stirr-%s", p.Channel),
}
}
Expand Down

0 comments on commit b3e7c1e

Please sign in to comment.