fixes lol
All checks were successful
Build and Push / build-all (push) Successful in 8m4s

This commit is contained in:
doomtube 2026-01-09 01:56:05 -05:00
parent 2cf84704da
commit a206a606f7
12 changed files with 231 additions and 111 deletions

View file

@ -824,7 +824,7 @@ void RealmController::getLiveRealms(const HttpRequestPtr &,
auto dbClient = app().getDbClient();
// SECURITY: Do NOT expose stream_key in public API - it allows stream hijacking
*dbClient << "SELECT r.name, r.viewer_count, r.viewer_multiplier, r.offline_image_url, r.title_color, "
"u.username, u.avatar_url "
"u.username, u.avatar_url, u.user_color "
"FROM realms r JOIN users u ON r.user_id = u.id "
"WHERE r.is_live = true AND r.is_active = true "
"ORDER BY (r.viewer_count * COALESCE(r.viewer_multiplier, 1)) DESC"
@ -850,6 +850,7 @@ void RealmController::getLiveRealms(const HttpRequestPtr &,
realm["avatarUrl"] = row["avatar_url"].isNull() ? "" : row["avatar_url"].as<std::string>();
realm["offlineImageUrl"] = row["offline_image_url"].isNull() ? "" : row["offline_image_url"].as<std::string>();
realm["titleColor"] = row["title_color"].isNull() ? "#ffffff" : row["title_color"].as<std::string>();
realm["colorCode"] = row["user_color"].isNull() ? "#561D5E" : row["user_color"].as<std::string>();
resp.append(realm);
}