Skip to content

Commit

Permalink
Change Rating.Value type from int to float32
Browse files Browse the repository at this point in the history
  • Loading branch information
Jisin0 committed Jun 4, 2024
1 parent 58d686f commit b29a31e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions imdb/advancedsearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ type AdvancedSearchTitleResult struct {
// Rating data about the title.
Rating struct {
// Value of rating out of 10.
Value int `json:"aggregateRating"`
Value float32 `json:"aggregateRating"`
// Number of votes received for the title.
Votes int64 `json:"voteCount"`
} `json:"ratingSummary"`
Expand Down Expand Up @@ -188,7 +188,7 @@ func (*ImdbClient) AdvancedSearchTitle(opts *AdvancedSearchTitleOpts) ([]*Advanc

err = json.Unmarshal([]byte(htmlquery.InnerText(dataNode)), &data)
if err != nil {
return nil, errors.New("failed to unmarshal results data")
return nil, errors.Wrap(err, "failed to unmarshal results data")
}

results := data.Props.PropsPage.SearchResults.TitleResults.Items
Expand Down

0 comments on commit b29a31e

Please sign in to comment.