Skip to content

Commit

Permalink
fix(ui-apps): update game db url (#3148)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher authored Sep 5, 2024
1 parent 87f0c27 commit cdc2d1b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src_assets/common/assets/web/apps.html
Original file line number Diff line number Diff line change
Expand Up @@ -481,14 +481,17 @@ <h4>{{ $t('apps.env_vars_about') }}</h4>
return Promise.resolve([]);
}
let searchName = name.replaceAll(/\s+/g, '.').toLowerCase();

// Use raw.githubusercontent.com to avoid CORS issues as we migrate the CNAME
let dbUrl = "https://raw.githubusercontent.com/LizardByte/GameDB/gh-pages";
let bucket = getSearchBucket(name);
return fetch("https://db.lizardbyte.dev/buckets/" + bucket + ".json").then(function (r) {
return fetch(`${dbUrl}/buckets/${bucket}.json`).then(function (r) {
if (!r.ok) throw new Error("Failed to search covers");
return r.json();
}).then(maps => Promise.all(Object.keys(maps).map(id => {
let item = maps[id];
if (item.name.replaceAll(/\s+/g, '.').toLowerCase().startsWith(searchName)) {
return fetch("https://db.lizardbyte.dev/games/" + id + ".json").then(function (r) {
return fetch(`${dbUrl}/games/${id}.json`).then(function (r) {
return r.json();
}).catch(() => null);
}
Expand Down

0 comments on commit cdc2d1b

Please sign in to comment.