diff --git a/season.go b/season.go index 825e555..c2098e7 100644 --- a/season.go +++ b/season.go @@ -13,9 +13,10 @@ type Season struct { RequestedTime string `json:"requested_time"` FirstTimeRaw string `json:"first_time"` FirstTime time.Time - NumEpisodes Link `json:"num_episodes"` - AllocateLink Link `json:"allocatelink"` - RejectLink Link `json:"rejectlink"` + NumEpisodes Link `json:"num_episodes"` + AllocateLink Link `json:"allocatelink"` + RejectLink Link `json:"rejectlink"` + Subtype ShowSeasonSubtype `json:"subtype"` } // isScheduled returns whether the Season has been scheduled. diff --git a/show.go b/show.go index e0b1ceb..73c1ac9 100644 --- a/show.go +++ b/show.go @@ -15,17 +15,18 @@ type Credit struct { // A MyRadio show contains seasons, each containing timeslots. // @TODO: Refactor this to something better named type ShowMeta struct { - ShowID int `json:"show_id"` - Title string `json:"title"` - CreditsString string `json:"credits_string"` - Credits []Credit `json:"credits"` - Description string `json:"description"` - ShowTypeID int `json:"show_type_id"` - Season Link `json:"seasons"` - EditLink Link `json:"editlink"` - ApplyLink Link `json:"applylink"` - MicroSiteLink Link `json:"micrositelink"` - Photo string `json:"photo"` + ShowID int `json:"show_id"` + Title string `json:"title"` + CreditsString string `json:"credits_string"` + Credits []Credit `json:"credits"` + Description string `json:"description"` + ShowTypeID int `json:"show_type_id"` + Season Link `json:"seasons"` + EditLink Link `json:"editlink"` + ApplyLink Link `json:"applylink"` + MicroSiteLink Link `json:"micrositelink"` + Photo string `json:"photo"` + Subtype ShowSeasonSubtype `json:"subtype"` } // Link represents a MyRadio action link. diff --git a/subtype.go b/subtype.go new file mode 100644 index 0000000..3e0d64b --- /dev/null +++ b/subtype.go @@ -0,0 +1,12 @@ +package myradio + +type ShowSeasonSubtype struct { + SubtypeID string `json:"id"` + Name string `json:"name"` + Class string `json:"class"` +} + +func (s *Session) GetAllShowSubtypes() (subtypes []ShowSeasonSubtype, err error) { + err = s.get("/showSubtype/all").Into(&subtypes) + return +}