From db59f7ef377c2ebcd90a74a210adcea74796899b Mon Sep 17 00:00:00 2001 From: marmei Date: Sat, 26 Sep 2020 18:35:16 +0200 Subject: [PATCH] Add XML tag: rating, credits --- src/struct-system.go | 28 ++++++++++++------------ src/struct-xml.go | 51 ++++++++++++++++++++++++++++++++++++++++++++ src/xepg.go | 9 ++++++++ xteve.go | 2 +- 4 files changed, 75 insertions(+), 15 deletions(-) diff --git a/src/struct-system.go b/src/struct-system.go index c9b11ec..ec9b58f 100644 --- a/src/struct-system.go +++ b/src/struct-system.go @@ -8,20 +8,20 @@ type SystemStruct struct { XML string } - APIVersion string - AppName string - ARCH string - BackgroundProcess bool - Branch string - Build string - Compatibility string - ConfigurationWizard bool - DBVersion string - Dev bool - DeviceID string - Domain string - PlexChannelLimit int - UnfilteredChannelLimit int + APIVersion string + AppName string + ARCH string + BackgroundProcess bool + Branch string + Build string + Compatibility string + ConfigurationWizard bool + DBVersion string + Dev bool + DeviceID string + Domain string + PlexChannelLimit int + UnfilteredChannelLimit int FFmpeg struct { DefaultOptions string diff --git a/src/struct-xml.go b/src/struct-xml.go index 107bc8b..c79f385 100644 --- a/src/struct-xml.go +++ b/src/struct-xml.go @@ -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"` diff --git a/src/xepg.go b/src/xepg.go index 4376292..76f60b7 100644 --- a/src/xepg.go +++ b/src/xepg.go @@ -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 diff --git a/xteve.go b/xteve.go index 3cae115..319727f 100644 --- a/xteve.go +++ b/xteve.go @@ -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"