media: add ImdbVotes field to Omdb struct
This commit is contained in:
@@ -68,5 +68,6 @@ func (c *Client) GetItem(imdbId string) (*Item, error) {
|
|||||||
Metascore: util.Atoi(b.Metascore, 0),
|
Metascore: util.Atoi(b.Metascore, 0),
|
||||||
RottenTomatoes: rt,
|
RottenTomatoes: rt,
|
||||||
ImdbRating: util.Atof64(b.ImdbRating, 0.0),
|
ImdbRating: util.Atof64(b.ImdbRating, 0.0),
|
||||||
|
ImdbVotes: util.Atoi(b.ImdbVotes, 0),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,4 +37,5 @@ type Item struct {
|
|||||||
Metascore int `json:"Metascore,omitempty"`
|
Metascore int `json:"Metascore,omitempty"`
|
||||||
RottenTomatoes int `json:"RottenTomatoes,omitempty"`
|
RottenTomatoes int `json:"RottenTomatoes,omitempty"`
|
||||||
ImdbRating float64 `json:"ImdbRating,omitempty"`
|
ImdbRating float64 `json:"ImdbRating,omitempty"`
|
||||||
|
ImdbVotes int `json:"ImdbVotes,omitempty"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,5 @@ func AsSHA256(o interface{}) string {
|
|||||||
// credits: https://blog.8bitzen.com/posts/22-08-2019-how-to-hash-a-struct-in-go
|
// credits: https://blog.8bitzen.com/posts/22-08-2019-how-to-hash-a-struct-in-go
|
||||||
h := sha256.New()
|
h := sha256.New()
|
||||||
h.Write([]byte(fmt.Sprintf("%v", o)))
|
h.Write([]byte(fmt.Sprintf("%v", o)))
|
||||||
|
|
||||||
return fmt.Sprintf("%x", h.Sum(nil))
|
return fmt.Sprintf("%x", h.Sum(nil))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user