✨ Add Data safety information to search results #16
1 changed files with 12 additions and 1 deletions
13
index.js
13
index.js
|
|
@ -97,7 +97,18 @@ fastify.get(
|
|||
await queue.addAll([
|
||||
...search.map(item => () => push(item)),
|
||||
...search.map(({ appId }) => async () => push(await googlePlay.app({ appId }))),
|
||||
...search.map(({ appId }) => async () => push({ appId, permissions: await googlePlay.permissions({ appId }) }))
|
||||
...search.map(({ appId }) => async () => push({ appId, permissions: await googlePlay.permissions({ appId }) })),
|
||||
...search.map(({ appId }) => async () => {
|
||||
try {
|
||||
push({ appId, dataSafety: await googlePlay.datasafety({ appId }) });
|
||||
}
|
||||
catch(error){
|
||||
console.error(`Could not fetch data safety for ${appId}:`, error);
|
||||
// Empty object is a known, safe "no data safety information" marker,
|
||||
// and keeps other apps in the queue unaffected.
|
||||
push({ appId, dataSafety: {} });
|
||||
}
|
||||
})
|
||||
]);
|
||||
})().catch(error => {
|
||||
if([
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue