Fix news and android

Signed-off-by: crueter <crueter@eden-emu.dev>
This commit is contained in:
crueter 2026-04-28 13:41:51 -04:00
parent 57b7b08fd8
commit 2fc7f9ae4d
No known key found for this signature in database
GPG key ID: 425ACD2D4830EBC6
2 changed files with 12 additions and 8 deletions

View file

@ -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);

View file

@ -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());
}
});
});
}