From 97efa5710b579ff1da87cbc2ac031d0703be06ca Mon Sep 17 00:00:00 2001 From: "chris062689@gmail.com" Date: Sun, 3 Mar 2019 18:42:16 -0500 Subject: [PATCH] Corrected gamedb lookup. --- src/commands/game.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/commands/game.js b/src/commands/game.js index 70f8ff2..80d4bd6 100644 --- a/src/commands/game.js +++ b/src/commands/game.js @@ -29,7 +29,14 @@ async function updateDatabase() { throw e; } - state.gameDB = JSON.parse(body); + state.gameDB = JSON.parse(body).map(x => { + return { + directory: x.directory, + title: x.title, + compatibility: x.compatibility + } + }); + state.lastGameDBUpdate = Date.now(); logger.info(`Updated games list (${state.gameDB.length} games)`); @@ -75,8 +82,8 @@ exports.command = async function (message) { return; } - const screenshot = `${iconBase}${bestGame.id}.png`; - const url = `${urlBase}${bestGame.id}/`; + const screenshot = `${iconBase}${bestGame.directory}.png`; + const url = `${urlBase}${bestGame.directory}/`; const compat = compatStrings[bestGame.compatibility];