I come up with this
```lua
local function get_jadeite_metadata()
local uris = {
"https://codeberg.org/mkrsym1/jadeite/raw/branch/master/metadata.json",
"https://notabug.org/mkrsym1/jadeite-mirror/raw/master/metadata.json"
}
local requests = {}
for _, uri in pairs(uris) do
local response = v1_network_fetch(uri)
table.insert(requests, response)
if response["ok"] then
jadeite_metadata = response.json()
break
end
end
if not jadeite_metadata then
local msg = "Jadeite metadata requests failed:\n"
for i, r in ipairs(requests) do
msg = string.format("%s\n%s (code %s): %s" msg, uris[i], r["status"], r["statusText"])
end
error(msg)
end
return jadeite_metadata
end
```
Regardless of whether it actually checks multiple sources, I'd say the larger issue here is that it results in an application crash which means you can't launch titles that don't depend on jadeite.
Isn't this suppose to check both links and not just error on first one?
https://github.com/an-anime-team/game-integrations/blob/656f8e8d73080b9e7be76f8fecd55b5ba7f4fcfa/games/star-rail/integration.lua#L51-L63
Rip codeberg https://github.com/an-anime-team/game-integrations/blob/656f8e8d73080b9e7be76f8fecd55b5ba7f4fcfa/games/star-rail/integration.lua#L46-L49
I come up with this
```lua local function get_jadeite_metadata() local uris = { "https://codeberg.org/mkrsym1/jadeite/raw/branch/master/metadata.json", "https://notabug.org/mkrsym1/jadeite-mirror/raw/master/metadata.json" } local requests = {} for _, uri in pairs(uris) do local response = v1_network_fetch(uri) table.insert(requests, response) if response["ok"] then jadeite_metadata = response.json() break end end if not jadeite_metadata then local msg = "Jadeite metadata requests failed:\n" for i, r in ipairs(requests) do msg = string.format("%s\n%s (code %s): %s" msg, uris[i], r["status"], r["statusText"]) end error(msg) end return jadeite_metadata end ```