From cdc2d1ba00c007d2452f2d02dd64450c131b8858 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Thu, 5 Sep 2024 16:52:46 -0400 Subject: [PATCH] fix(ui-apps): update game db url (#3148) --- src_assets/common/assets/web/apps.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src_assets/common/assets/web/apps.html b/src_assets/common/assets/web/apps.html index 9a8c65d1..7e156e77 100644 --- a/src_assets/common/assets/web/apps.html +++ b/src_assets/common/assets/web/apps.html @@ -481,14 +481,17 @@ 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); }