feat: implement LiveTicker functionality with sound notifications and UI updates
All checks were successful
Code Analysis and Production Deploy / analyze (push) Successful in 7m10s
Code Analysis and Production Deploy / deploy-production (push) Has been skipped
Code Analysis and Production Deploy / deploy-test (push) Successful in 3m11s

This commit is contained in:
Torsten Schulz (local)
2026-10-22 23:57:22 +02:00
parent 6b9198ac41
commit 6369249f40
10 changed files with 250 additions and 8 deletions

View File

@@ -16,6 +16,11 @@ function score(data) {
return `${home ?? 0}:${away ?? 0}`
}
function completedTime(data, fallback) {
const timestamp = Date.parse(data.end_date || data.entry_date || '')
return Number.isFinite(timestamp) ? timestamp : fallback
}
export async function refreshLiveTicker(now = new Date()) {
const season = getCurrentSeasonSlug(now)
const { data } = await readSpielplanData({ season })
@@ -37,7 +42,7 @@ export async function refreshLiveTicker(now = new Date()) {
const payload = await response.json()
const report = payload?.data
if (!report) throw new Error('Keine Spieldaten erhalten')
const completedAt = report.is_completed ? nowMs : null
const completedAt = report.is_completed ? completedTime(report, nowMs) : null
const previous = cache.get(meetingId)
cache.set(meetingId, {
meetingId,