speedcontrol / nodecg-speedcontrol

NodeCG bundle to help facilitate the running of speedrunning marathons, including overlays.
MIT License
45 stars 34 forks source link

Improve speedrun.com Twitch directory lookup #89

Closed zoton2 closed 3 years ago

zoton2 commented 4 years ago

Sometimes the first game the speedrun.com API finds is not correct, similar to the issue we had with the Twitch API. Also sometimes it can't find it by name at all even though said name exists on their site, for example "Final Fantasy XIII" appears to return 2 other games with that in their name, but not the actual game with that exact name.

zoton2 commented 3 years ago

I have added a similar check as some other API searches where it looks for an exact result in the top 10 if possible. In the case of where a game just can't be found even if it's on the speedrun.com website and in their own search, I fall back to trying to find it via an unsupported endpoint (which will silently fail if an error occurs), but hopefully that should only be used in rare cases.