Also remove redundant type Episodes []*Episode -- the Episodes type
didn't have any methods.
TemporaryVotes Rating // Votes from people who are still watching this.
Reviews Rating // Votes from reviewers.
- Episodes Episodes // List of episodes.
+ Episodes []*Episode // List of episodes.
Awards []string
Resources Resources
func (a *Anime) EpisodeByNumber(number int) *Episode {
return a.EpisodeByString(strconv.Itoa(number))
}
+
+func (a *Anime) EpisodeByEID(eid EID) *Episode {
+ if a == nil {
+ return nil
+ }
+ for _, ep := range a.Episodes {
+ if ep.EID == eid {
+ return ep
+ }
+ }
+ return nil
+}
Cached time.Time // When the data was retrieved from the server
}
-
-type Episodes []*Episode