I’m working on a rewrite of my bot that also involves migrating to the new API, and the answer to the question in the title of this thread influences how I cache the game ID/name associations. I don’t care about thumbnails, just the text. Here are the two methods I’ve come up with:
An LRU sort of cache, which removes records only to conserve space. The few “game” titles that my auto-host is currently scripted to ignore (not really games, but things like IRL, social eating, talk shows, and E3 rebroadcasts) would never expire unless the ignore list was refreshed, since they’d be checked every few minutes when I’m not streaming.
A straight expire time of a few days after a record is added, or refreshed in the case of the ignore list.
I’d prefer to use the LRU scheme, if possible.
As far as I know, a Game ID/Name association should never change.
They are linked to entries for the game in the GiantBomb database, so they shouldn’t ever change as far as I know.
The “special” games like IRL/Creative as you list, may do but afaik the association shouldn’t change
If that’s truly the case, then great! It seems like an LRU cache would work.
As Barry mentioned, Game ID/Name association shouldn’t change, but there is some rare cases which are worth noting in case it may impact your app.
For example, one thing I’ve run into is with WoW and how they cycle expansions. For example, when Battle for Azeroth went into beta, that was added to the games list, and Legion removed, same as has happened with previous expansions. So if you used the games endpoint and looked up a game by name, for ‘World of Warcraft: Battle for Azeroth’ you’ll get specifically that, but if you set the name to ‘World of Warcraft: Warlords of Draenor’ or ‘World of Warcraft: Cataclysm’ they’ll return the original ‘World of Warcraft’, including the original game ID.
That should be fine, I think. The only time I’ll be doing a game lookup by name is for my auto-host ignore list, which it looks like I’ll just need to update each year for E3. I’ve been comparing the first 3 characters of the game title with "E3 ", which I won’t be able to do anymore. Aside from that, I’m only looking up games by ID.
There have been cases where games have been merged, so one ID was removed/void so they both could be linked together.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.