speedcontrol / nodecg-speedcontrol

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

Wrong Twitch game set when game name has trailing space #136

Open strotlog opened 2 years ago

strotlog commented 2 years ago

Steps:

  1. Use the game name "Midnight Manor " <- note the trailing space
  2. Set Twitch status using the game name

Bug: The game is inadvertently set to 'Delaware St. John: Volume 1: The Curse of Midnight Manor' (id=7941) Expected: The game is set to 'Midnight Manor' (id=906445956), or an error is thrown

Looks like src/extension/srcom-api.ts has an opportunity where it could trim the string. Since it does not currently trim, the exact API fails and searchForTwitchGame goes on to call Twitch's "unsupported API", always selecting the first match from that. This behavior results in weird game names appearing for unclear reasons, as spaces often cannot be seen.