Skip to content

Commit

Permalink
in top games list show games with 6 or more reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
anmarchenko committed Nov 17, 2024
1 parent 4a686ab commit da25300
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/skaro/igdb/igdb.ex
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ defmodule Skaro.IGDB do

defp top_games_filters(filters) do
("where first_release_date != null " <>
"& aggregated_rating != null & aggregated_rating_count > 9 & aggregated_rating > 79" <>
"& aggregated_rating != null & aggregated_rating_count > 5 & aggregated_rating > 79" <>
"& name != \"The Witness\"")
|> filter_if_present(:platform, filters)
|> filter_if_present(:year, filters)
Expand Down
6 changes: 3 additions & 3 deletions test/skaro/igdb/igdb_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ defmodule Skaro.IGDBTest do
assert ["igdb_client_id"] = Conn.get_req_header(conn, "client-id")

assert {:ok,
"where first_release_date != null & aggregated_rating != null & aggregated_rating_count > 9 & aggregated_rating > 79" <>
"where first_release_date != null & aggregated_rating != null & aggregated_rating_count > 5 & aggregated_rating > 79" <>
_, conn} = Conn.read_body(conn)

Conn.resp(conn, 200, File.read!("./test/support/fixtures/igdb_top_games.json"))
Expand All @@ -329,7 +329,7 @@ defmodule Skaro.IGDBTest do
assert ["igdb_client_id"] = Conn.get_req_header(conn, "client-id")

assert {:ok,
"where first_release_date != null & aggregated_rating != null & aggregated_rating_count > 9 & aggregated_rating > 79& name != \"The Witness\"" <>
"where first_release_date != null & aggregated_rating != null & aggregated_rating_count > 5 & aggregated_rating > 79& name != \"The Witness\"" <>
" & platforms = (42);" <>
_, conn} = Conn.read_body(conn)

Expand All @@ -353,7 +353,7 @@ defmodule Skaro.IGDBTest do
assert ["igdb_client_id"] = Conn.get_req_header(conn, "client-id")

assert {:ok,
"where first_release_date != null & aggregated_rating != null & aggregated_rating_count > 9 & aggregated_rating > 79& name != \"The Witness\"" <>
"where first_release_date != null & aggregated_rating != null & aggregated_rating_count > 5 & aggregated_rating > 79& name != \"The Witness\"" <>
" & first_release_date >= 1451606400 & first_release_date < 1483228800;" <>
_, conn} = Conn.read_body(conn)

Expand Down

0 comments on commit da25300

Please sign in to comment.