feat: add new games.extra.old_id

This commit is contained in:
Pedro Ivo Hudson 2024-01-20 21:10:37 -03:00
parent 82772e0c02
commit e857adef78
2 changed files with 13 additions and 4 deletions

View File

@ -9,7 +9,11 @@ export const lookup = (type) => {
}
}
const game = games[type]
let game = games[type]
Object.keys(games).forEach((id) => {
if (games[id].extra && games[id].extra.old_id) game = games[id]
})
if (!game) { throw Error('Invalid game: ' + type) }

View File

@ -21,12 +21,17 @@ sortedGamesIds.forEach(key => {
})
let generated = ''
generated += '| GameDig Type ID | Name | See Also\n'
generated += '|---|---|---\n'
generated += '| GameDig Type ID | Old ID | Name | See Also\n'
generated += '|---|---|---|---\n'
for (const id in sortedGames) {
const game = sortedGames[id]
generated += '| ' + id.padEnd(10, ' ') + ' | ' + game.name
if (!game?.extra?.old_id) {
game.extra = {}
game.extra.old_id = ' '
}
generated += '| ' + id.padEnd(10, ' ') + ' | ' + game.extra.old_id + ' | ' + game.name
const notes = []
if (game?.extra?.doc_notes) {
notes.push('[Notes](#' + game.extra.doc_notes + ')')