@@ -35,7 +35,7 @@ def discover(request: Request, conn: sqlite3.Connection = Depends(get_db)):
3535 igdb_summary, description, igdb_screenshots, total_rating,
3636 igdb_rating, aggregated_rating, genres, playtime_hours
3737 FROM games
38- WHERE igdb_id IS NOT NULL""" + EXCLUDE_HIDDEN_FILTER + """
38+ WHERE igdb_id IS NOT NULL AND igdb_id > 0 """ + EXCLUDE_HIDDEN_FILTER + """
3939 ORDER BY total_rating DESC NULLS LAST"""
4040 )
4141 library_games = cursor .fetchall ()
@@ -119,7 +119,7 @@ def fetch_by_popularity_type(pop_type, limit=10):
119119 igdb_summary, description, igdb_screenshots, total_rating,
120120 igdb_rating, aggregated_rating, genres, playtime_hours
121121 FROM games
122- WHERE igdb_id IS NOT NULL AND total_rating >= 90""" + EXCLUDE_HIDDEN_FILTER + """
122+ WHERE igdb_id IS NOT NULL AND igdb_id > 0 AND total_rating >= 90""" + EXCLUDE_HIDDEN_FILTER + """
123123 ORDER BY total_rating DESC
124124 LIMIT 10"""
125125 )
@@ -131,7 +131,7 @@ def fetch_by_popularity_type(pop_type, limit=10):
131131 igdb_summary, description, igdb_screenshots, total_rating,
132132 igdb_rating, aggregated_rating, genres, playtime_hours
133133 FROM games
134- WHERE igdb_id IS NOT NULL
134+ WHERE igdb_id IS NOT NULL AND igdb_id > 0
135135 AND total_rating >= 75
136136 AND total_rating < 90
137137 AND aggregated_rating IS NULL""" + EXCLUDE_HIDDEN_FILTER + """
@@ -146,7 +146,7 @@ def fetch_by_popularity_type(pop_type, limit=10):
146146 igdb_summary, description, igdb_screenshots, total_rating,
147147 igdb_rating, aggregated_rating, genres, playtime_hours
148148 FROM games
149- WHERE igdb_id IS NOT NULL AND playtime_hours > 0""" + EXCLUDE_HIDDEN_FILTER + """
149+ WHERE igdb_id IS NOT NULL AND igdb_id > 0 AND playtime_hours > 0""" + EXCLUDE_HIDDEN_FILTER + """
150150 ORDER BY playtime_hours DESC
151151 LIMIT 10"""
152152 )
@@ -158,7 +158,7 @@ def fetch_by_popularity_type(pop_type, limit=10):
158158 igdb_summary, description, igdb_screenshots, total_rating,
159159 igdb_rating, aggregated_rating, genres, playtime_hours
160160 FROM games
161- WHERE igdb_id IS NOT NULL AND aggregated_rating >= 80""" + EXCLUDE_HIDDEN_FILTER + """
161+ WHERE igdb_id IS NOT NULL AND igdb_id > 0 AND aggregated_rating >= 80""" + EXCLUDE_HIDDEN_FILTER + """
162162 ORDER BY aggregated_rating DESC
163163 LIMIT 10"""
164164 )
@@ -170,7 +170,7 @@ def fetch_by_popularity_type(pop_type, limit=10):
170170 igdb_summary, description, igdb_screenshots, total_rating,
171171 igdb_rating, aggregated_rating, genres, playtime_hours
172172 FROM games
173- WHERE igdb_id IS NOT NULL""" + EXCLUDE_HIDDEN_FILTER + """
173+ WHERE igdb_id IS NOT NULL AND igdb_id > 0 """ + EXCLUDE_HIDDEN_FILTER + """
174174 ORDER BY RANDOM()
175175 LIMIT 10"""
176176 )
0 commit comments