X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=server%2Fmodels%2FGame.js;h=017d195d2045c5f84a8878283cac2529fa355407;hp=a3ddc3c4f793787b5fe84ed7a61052a18c71b905;hb=77c5096644d83aaae8ab1dd42a5cde524507cf9d;hpb=f51c37cf24a7d695cdd51a3b0298a8ff64c3963a diff --git a/server/models/Game.js b/server/models/Game.js index a3ddc3c4..017d195d 100644 --- a/server/models/Game.js +++ b/server/models/Game.js @@ -131,9 +131,8 @@ const GameModel = getByUser: function(uid, excluded, cb) { db.serialize(function() { - // Next query is fine because a player appear at most once in a game const query = - "SELECT gid " + + "SELECT DISTINCT gid " + "FROM Players " + "WHERE uid " + (excluded ? "<>" : "=") + " " + uid; db.all(query, (err,gameIds) => {