Corrected gamedb lookup.

This commit is contained in:
chris062689@gmail.com 2019-03-03 18:42:16 -05:00
parent 73202911d9
commit 97efa5710b

View file

@ -29,7 +29,14 @@ async function updateDatabase() {
throw e; 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(); state.lastGameDBUpdate = Date.now();
logger.info(`Updated games list (${state.gameDB.length} games)`); logger.info(`Updated games list (${state.gameDB.length} games)`);
@ -75,8 +82,8 @@ exports.command = async function (message) {
return; return;
} }
const screenshot = `${iconBase}${bestGame.id}.png`; const screenshot = `${iconBase}${bestGame.directory}.png`;
const url = `${urlBase}${bestGame.id}/`; const url = `${urlBase}${bestGame.directory}/`;
const compat = compatStrings[bestGame.compatibility]; const compat = compatStrings[bestGame.compatibility];