Add XML tag: rating, credits

This commit is contained in:
marmei
2020-09-26 18:35:16 +02:00
parent b407ec5bf0
commit db59f7ef37
4 changed files with 75 additions and 15 deletions

View File

@@ -42,6 +42,9 @@ type Program struct {
Country []*Country `xml:"country"`
EpisodeNum []*EpisodeNum `xml:"episode-num"`
Poster []Poster `xml:"icon"`
Credits Credits `xml:"credits,omitempty"` //`xml:",innerxml,omitempty"`
Rating []Rating `xml:"rating"`
StarRating []StarRating `xml:"star-rating"`
Language []*Language `xml:"language"`
Video Video `xml:"video"`
Date string `xml:"date"`
@@ -75,6 +78,19 @@ type Category struct {
Value string `xml:",chardata"`
}
// Rating : Bewertung
type Rating struct {
System string `xml:"system,attr"`
Value string `xml:"value"`
Icon []Icon `xml:"icon"`
}
// StarRating : Bewertung / Kritiken
type StarRating struct {
Value string `xml:"value"`
System string `xml:"system,attr"`
}
// Language : Sprachen
type Language struct {
Value string `xml:",chardata"`
@@ -100,6 +116,41 @@ type Poster struct {
Width string `xml:"width,attr"`
}
// Credits : Credits
type Credits struct {
Director []Director `xml:"director,omitempty"`
Actor []Actor `xml:"actor,omitempty"`
Writer []Writer `xml:"writer,omitempty"`
Presenter []Presenter `xml:"presenter,omitempty"`
Producer []Producer `xml:"producer,omitempty"`
}
// Director : Director
type Director struct {
Value string `xml:",chardata"`
}
// Actor : Actor
type Actor struct {
Value string `xml:",chardata"`
Role string `xml:"role,attr,omitempty"`
}
// Writer : Writer
type Writer struct {
Value string `xml:",chardata"`
}
// Presenter : Presenter
type Presenter struct {
Value string `xml:",chardata"`
}
// Producer : Producer
type Producer struct {
Value string `xml:",chardata"`
}
// Video : Video Metadaten
type Video struct {
Aspect string `xml:"aspect,omitempty"`

View File

@@ -713,6 +713,15 @@ func getProgramData(xepgChannel XEPGChannelStruct) (xepgXML XMLTV, err error) {
// Category (Kategorie)
getCategory(program, xmltvProgram, xepgChannel)
// Credits : (Credits)
program.Credits = xmltvProgram.Credits
// Rating (Bewertung)
program.Rating = xmltvProgram.Rating
// StarRating (Bewertung / Kritiken)
program.StarRating = xmltvProgram.StarRating
// Country (Länder)
program.Country = xmltvProgram.Country

View File

@@ -39,7 +39,7 @@ var GitHub = GitHubStruct{Branch: "master", User: "xteve-project", Repo: "xTeVe-
const Name = "xTeVe"
// Version : Version, die Build Nummer wird in der main func geparst.
const Version = "2.1.2.0126"
const Version = "2.1.2.0127"
// DBVersion : Datanbank Version
const DBVersion = "2.1.0"