Skip to content

Commit ebed3f5

Browse files
committed
fix(speedrun.com): fallback for individual runs
1 parent a61a951 commit ebed3f5

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

background/sources/collections/speedrundotcom.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,20 @@ export default async () => {
9797
};
9898

9999
const addMetaToRun = async (run) => {
100-
const meta = await getMetaForRun(run.url);
101-
if (!meta) { return false; }
102-
run.url = meta.url;
103-
run.desc = meta.desc;
104-
const results = await Promise.all([
105-
addUsersToRun(run, meta),
106-
addGameToVideo(run, meta)
107-
]);
108-
return results[0] && results[1];
100+
try {
101+
const meta = await getMetaForRun(run.url);
102+
if (!meta) { return false; }
103+
run.url = meta.url;
104+
run.desc = meta.desc;
105+
const results = await Promise.all([
106+
addUsersToRun(run, meta),
107+
addGameToVideo(run, meta)
108+
]);
109+
return results[0] && results[1];
110+
} catch (err) {
111+
console.warn('Failed to get the run', run.url);
112+
return false;
113+
}
109114
};
110115

111116
const key = await getSpeedrundotcomKey();

0 commit comments

Comments
 (0)