omdb: strip non numeric from ImdbVotes

Closes #24
This commit is contained in:
James Bayliss
2021-02-23 18:55:16 +00:00
parent 7472fcbf0c
commit f0bf97293c
3 changed files with 47 additions and 3 deletions

View File

@@ -63,7 +63,7 @@ func (c *Client) GetItem(imdbId string) (*Item, error) {
Metascore: util.Atoi(b.Metascore, 0),
RottenTomatoes: rt,
ImdbRating: util.Atof64(b.ImdbRating, 0.0),
ImdbVotes: util.Atoi(b.ImdbVotes, 0),
ImdbVotes: util.Atoi(util.StripNonNumeric(b.ImdbVotes), 0),
Language: b.Language,
Country: b.Country,
}, nil