Show attendance and weather before live ticker kickoff (by Codex)
This commit is contained in:
1 parent
ef25407484
commit
b845bbfcbc
10 files changed
+144
-14
No files matched your search
@@ -175,8 +175,8 @@ std::string App::postmatch_report_markup(const Json &report) {
|
||||
"<strong>" + live_text(report.at("away").at("name")) +
|
||||
"</strong></div></header>";
|
||||
out += "<p class=\"postmatch-report-meta\">" +
|
||||
live_text("Spielort und Zuschauer nicht aufgezeichnet · "
|
||||
"Spielerzuordnung nicht aufgezeichnet") +
|
||||
live_text(live_match_info_text(report, postmatch_data_.at("surface") == "indoor") +
|
||||
" · Spielort und Spielerzuordnung nicht aufgezeichnet") +
|
||||
"</p><div id=\"postmatch-events\" class=\"postmatch-event-columns\">" +
|
||||
postmatch_events(report, "home") + postmatch_events(report, "away") +
|
||||
"</div><section class=\"postmatch-timeline\"><div "
|
||||
@@ -347,6 +347,11 @@ std::string App::render_postmatch() {
|
||||
} else if (postmatch_tab_ == "overview") {
|
||||
auto total = postmatch_data_.at("overview");
|
||||
total["games"] = matches.size();
|
||||
total["attendance"] = int64_t(0);
|
||||
for (const auto &m : matches) {
|
||||
if (m.at("attendance").is_null()) { total["attendance"] = nullptr; break; }
|
||||
total["attendance"] = total.at("attendance").get<int64_t>() + m.at("attendance").get<int64_t>();
|
||||
}
|
||||
for (const auto *key : {"goals", "yellow", "red"})
|
||||
total[key] = 0;
|
||||
for (const auto &m : matches)
|
||||
@@ -375,7 +380,9 @@ std::string App::render_postmatch() {
|
||||
: "—") +
|
||||
" Tore pro Partie") +
|
||||
"</p><p class=\"postmatch-scope-note\">" +
|
||||
live_text("Zuschauer nicht aufgezeichnet · keine Ligagesamtwertung") +
|
||||
live_text(total.at("attendance").is_null()
|
||||
? "Zuschauer nicht aufgezeichnet · keine Ligagesamtwertung"
|
||||
: "Aufgezeichnete menschliche Partien · keine Ligagesamtwertung") +
|
||||
"</p></section>";
|
||||
} else {
|
||||
const Json *table = nullptr;
|
||||
@@ -471,7 +478,7 @@ std::string App::render_postmatch() {
|
||||
detail += "<div><dt>" + live_text(label) + "</dt><dd>" +
|
||||
live_text(postmatch_count(final.at(key)[side])) +
|
||||
"</dd></div>";
|
||||
detail += "<div><dt>Zuschauer</dt><dd>—</dd></div></dl>";
|
||||
detail += "<div><dt>Zuschauer</dt><dd>" + live_text(postmatch_count(match->at("attendance"))) + "</dd></div></dl>";
|
||||
} else
|
||||
detail += "<p>" +
|
||||
live_text("Keine Partie dieses Teams in der gehaltenen "
|
||||
|
||||
Reference in new issue
Block a user