SteamGridDB / steam-rom-manager

An app for managing ROMs in Steam
GNU General Public License v3.0
1.88k stars 120 forks source link

Enhance Retrogaming.cloud Integration #46

Closed AlexDobeck closed 7 years ago

AlexDobeck commented 7 years ago

It looks like Steam Rom Manager is currently making more requests than necessary when talking to the retrogaming.cloud api?

Currently retrogaming-cloud.worker.ts will make a search request for the title: /api/v1/game?name=`%${title}%`

Then take every result and make a request to get media: /api/v1/game/${gameId}/media

At that point it will filter the results by 'name' using the fuzzy logic. Many search results return 15 results so this expends 16 calls per game to just traverse the list of returned games.

Instead the logic to filter by name should be moved up to the retrieveUrls method.

For instance: if (listData[i].id !== undefined) promises.push(this.retrieveMediaData(listData[i].id));

Could instead be: if (listData[i].id !== undefined && listData[i].name && this.proxy.fuzzyMatcher.fuzzyEqual(this.proxy.title, listData[i].name, true, true)) promises.push(this.retrieveMediaData(listData[i].id));

FrogTheFrog commented 7 years ago

@AlexDobeck Nice find! I will get to it as soon as I'm done with #44.