summaryrefslogtreecommitdiff
path: root/tools/elo.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-09-17 12:10:11 +0200
committerTor Andersson <tor@ccxvii.net>2023-09-20 20:29:16 +0200
commit58530e70bbd741d29fbc7b7904c37dcbc3ec1648 (patch)
treef87ae38fcbbbd040d06257e6ae30c4eb7c8eafe5 /tools/elo.js
parent5649e827d2cbb3df9c2b035d659ebdf27b7e3d68 (diff)
downloadserver-58530e70bbd741d29fbc7b7904c37dcbc3ec1648.tar.gz
Move mtime and active into games table.
Avoid joining with game_state for all the game list views.
Diffstat (limited to 'tools/elo.js')
-rw-r--r--tools/elo.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/elo.js b/tools/elo.js
index 95ca58b..a6f9c9d 100644
--- a/tools/elo.js
+++ b/tools/elo.js
@@ -4,7 +4,7 @@ const sqlite3 = require("better-sqlite3")
const db = new sqlite3("db")
-const SQL_SELECT_GAMES = db.prepare("select * from games where status>1 and user_count=player_count and player_count>1 order by xtime")
+const SQL_SELECT_GAMES = db.prepare("select * from rated_games_view order by mtime")
const SQL_SELECT_RATING = db.prepare("select * from player_rating_view where game_id=?")
const SQL_INSERT_RATING = db.prepare("insert or replace into ratings (title_id,user_id,rating,count,last) values (?,?,?,?,?)")