mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-29 02:33:48 +00:00
Fix news and android
Signed-off-by: crueter <crueter@eden-emu.dev>
This commit is contained in:
parent
57b7b08fd8
commit
2fc7f9ae4d
|
|
@ -133,7 +133,7 @@ std::optional<Release> Release::FromJson(const nlohmann::json& json, const std::
|
|||
rel.host = host;
|
||||
|
||||
const auto release_base =
|
||||
fmt::format("{}/{}/releases", host, repo);
|
||||
fmt::format("{}/{}/releases", Common::g_build_auto_update_website, repo);
|
||||
const auto fallback_html = fmt::format("{}/tag/{}", release_base, rel.tag);
|
||||
rel.html_url = json.value("html_url", fallback_html);
|
||||
|
||||
|
|
|
|||
|
|
@ -467,14 +467,18 @@ void EnsureBuiltinNewsLoaded() {
|
|||
ImportReleases(releases);
|
||||
|
||||
LOG_INFO(Service_BCAT, "news: {} entries loaded from cache", NewsStorage::Instance().ListAll().size());
|
||||
} else if (const auto fresh = Common::Net::GetReleasesBody()) {
|
||||
const std::string_view body = fresh.value();
|
||||
WriteCachedJson(body);
|
||||
const auto releases = Common::Net::Release::ListFromJson(body, Common::g_build_auto_update_stable_api, Common::g_build_auto_update_stable_repo);
|
||||
ImportReleases(releases);
|
||||
|
||||
LOG_INFO(Service_BCAT, "news: {} entries updated from Forgejo", NewsStorage::Instance().ListAll().size());
|
||||
}
|
||||
|
||||
std::thread([] {
|
||||
if (const auto fresh = Common::Net::GetReleasesBody()) {
|
||||
const std::string_view body = fresh.value();
|
||||
WriteCachedJson(body);
|
||||
const auto releases = Common::Net::Release::ListFromJson(body, Common::g_build_auto_update_stable_api, Common::g_build_auto_update_stable_repo);
|
||||
ImportReleases(releases);
|
||||
|
||||
LOG_INFO(Service_BCAT, "news: {} entries updated from Forgejo", NewsStorage::Instance().ListAll().size());
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue