developer-relations icon indicating copy to clipboard operation
developer-relations copied to clipboard

[FEATURE REQUEST] /lol/spectator/v4/active-games/{gameId}

Open mikaeldui opened this issue 3 years ago • 8 comments

It'd be nice to be able to pull an active game by Game ID.

For example, if one wants to get a Featured Game, one has to lookup the summoner ID for one of the players and then lookup the active game by that summoner ID.

If a player looks at an active game for "Hyper Carry" and 2 hours later refreshes the page, using only the summoner as key for that game, another game would show up.

If the key for that game is the entire team, it's possible to lookup the match history for "Hyper Carry" and then figure out which Game ID it was and then pull the match results, given that the team hasn't played together before.

However, this results it many extra API calls, if one doesn't decide to temporarily store the Game ID somewhere together with the players IDs so that the active game can be requested using only the Game ID.

mikaeldui avatar Jan 30 '22 16:01 mikaeldui

How would you find the gameId of an active game without first requesting the game by summonerId?

And at that point you already know what players are in the game so you wont have to call it again. Now if you don't keep that information saved then how would you know the game Id for the other players, after all you would have to make summonerId based calls for them as well.

DoctressWasTaken avatar Jan 30 '22 16:01 DoctressWasTaken

How would you find the gameId of an active game without first requesting the game by summonerId?

Featured Games doesn't return the Summoner IDs, only Summoner Names.

mikaeldui avatar Jan 30 '22 16:01 mikaeldui

Sounds like the issue is with the "Featured Games" endpoint then and not with the spectator endpoint.

Your issue seems to be very specific to your usage of the featured games endpoint which basically no-one uses.

DoctressWasTaken avatar Jan 30 '22 16:01 DoctressWasTaken

Sounds like the issue is with the "Featured Games" endpoint then and not with the spectator endpoint.

Your issue seems to be very specific to your usage of the featured games endpoint which basically no-one uses.

Not really, and a link shared to an active game would suddenly also be a link to the match results. Even 100 years after. Imagine a 5v5 team. How easy would it be to identify match "1234567" of the 100 matches they've played, using only their summoners as key to the match? It's not a unique key to the match, which might be the case for many solo/duo queue matches.

mikaeldui avatar Jan 30 '22 16:01 mikaeldui

Have you considered creating your website link with both summonerId and gameId?

DoctressWasTaken avatar Jan 30 '22 17:01 DoctressWasTaken

Have you considered creating your website link with both summonerId and gameId?

My current stateless work-around, but 140 lines of code at the moment.

mikaeldui avatar Jan 30 '22 17:01 mikaeldui

I wouldnt call it a workaround but proper handling.

You want an endpoint that is relevant only to this very specific case of yours. But what if you add a "Return to user profile" link to your page. Suddenly you need the summonerID as well anyway. So just forcing a structure based on gameId, which first requires you to make even more API calls to even get to, now that sounds like a workaround.

DoctressWasTaken avatar Jan 30 '22 17:01 DoctressWasTaken

I wouldnt call it a workaround but proper handling.

You want an endpoint that is relevant only to this very specific case of yours. But what if you add a "Return to user profile" link to your page. Suddenly you need the summonerID as well anyway. So just forcing a structure based on gameId, which first requires you to make even more API calls to even get to, now that sounds like a workaround.

The SPA keeps track of navigation, and /lol/match doesn't require a summoner ID, neither does it accept a summoner ID.

mikaeldui avatar Jan 30 '22 17:01 mikaeldui