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));
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));