Skip to content

Commit abe6d1c

Browse files
committed
"N/A" for metacritic should mean missing score
this was a bug that created a PercentageScore in any case, instead of a MissingScore for the value "N/A".
1 parent 009d2dd commit abe6d1c

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/score_fetcher.cr

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,9 @@ class ScoreFetcher
9898

9999
# metacritic from omdb
100100
meta_score = omdb["Metascore"].to_s
101-
movie.score[:metacritic] = PercentageScore.new(
102-
if meta_score == "N/A"
103-
nil
104-
else
105-
"#{meta_score}/100"
106-
end
107-
)
101+
if meta_score != "N/A"
102+
movie.score[:metacritic] = PercentageScore.new("#{meta_score}/100")
103+
end
108104

109105
# tomato from omdb
110106
tomato_score = omdb["Ratings"].as_a.find do |rating|

0 commit comments

Comments
 (0)