RetroAchievements / RAWeb

The RetroAchievements.org platform. Includes core functionality for managing achievements, game data, and community features.
https://retroachievements.org
GNU General Public License v3.0
257 stars 88 forks source link

Game information on some games is missing from the api #2761

Open V-Karch opened 2 weeks ago

V-Karch commented 2 weeks ago

Describe the bug Data is missing when requesting it from the api using retroachievements-js I figured I could post this here instead of on the retroachievements-js github since this is about data being stored and not about functionality being broken as far as I'm aware

To Reproduce

  1. Set up retroachievements-js
  2. Make a file titled main.mjs
  3. Fill the file with the following, replacing placeholders with your api information
    
    import { buildAuthorization, getGame } from "@retroachievements/api";

const username = "username"; const webApiKey = "api_key";

const authorization = buildAuthorization({ username, webApiKey });

const game = await getGame(authorization, { gameId: 16211 });

console.log(game);

4. Run the code with nodejs, `node main.mjs`
5. Output:
```js
{
  title: 'Pokemon White Version',
  gameTitle: 'Pokemon White Version',
  consoleId: 18,
  consoleName: 'Nintendo DS',
  console: 'Nintendo DS',
  forumTopicId: 10492,
  flags: 0,
  gameIcon: '/Images/046275.png',
  imageIcon: '/Images/046275.png',
  imageTitle: '/Images/033230.png',
  imageIngame: '/Images/033229.png',
  imageBoxArt: '/Images/032988.png',
  publisher: '',
  developer: '',
  genre: '',
  released: '2010-09-18',
  releasedAtGranularity: 'day'
}

Expected behavior Publisher should be "Nintendo, The Pokemon Company" Developer should be "Game Freak" Genre should be "Turn-based RPG"

This information shows up on the website, but not in the api

Screenshots No need for a screenshot as the issue is shown in code

Desktop (please complete the following information):

Additional context Other games that I've seen that are similarly affected are Pokemon Diamond, and Pokemon White 2. However, Pokemon Black's data does display correctly, as shown below:

{
  title: 'Pokemon Black Version',
  gameTitle: 'Pokemon Black Version',
  consoleId: 18,
  consoleName: 'Nintendo DS',
  console: 'Nintendo DS',
  forumTopicId: 10333,
  flags: 0,
  gameIcon: '/Images/046274.png',
  imageIcon: '/Images/046274.png',
  imageTitle: '/Images/032689.png',
  imageIngame: '/Images/032690.png',
  imageBoxArt: '/Images/032691.png',
  publisher: 'Nintendo',
  developer: 'Game Freak',
  genre: 'Turn-based RPG',
  released: '2011-03-04',
  releasedAtGranularity: 'day'
}
wescopeland commented 2 weeks ago

This is happening because the information is associated with linked hubs rather than data in the game table.

V-Karch commented 2 weeks ago

@wescopeland oh interesting, I wonder how that could've happened

wescopeland commented 2 weeks ago

Right now hubs are a bit magical. I believe this API issue will occur for any of the game data that appears to be hyperlinked in the game page. For example, if the genre is a clickable link, I bet it doesn't surface correctly in the API.

Right now hubs are in a bizarre place in the DB. We're going to fix this imminently, but until it's fixed this issue will unfortunately continue to surface.