Stabilizza regia, live web e sync punteggi app nativa.
Corregge scadenza token regia oltre le 8h, tabellone HTML sulla pagina live, pulsanti pausa/ripresa in regia, link admin e broadcast ActionCable diretto. App Android: overlay branding, sync score da regia via WebSocket con reconnect e poll. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -19,4 +19,22 @@ module AdminHelper
|
||||
mins = minutes % 60
|
||||
hours.positive? ? "#{hours}h #{mins}m" : "#{mins} min"
|
||||
end
|
||||
|
||||
def admin_session_watch_links(session)
|
||||
links = []
|
||||
if session.matchlivetv_platform?
|
||||
links << { label: "Pagina live", url: session.watch_page_url }
|
||||
end
|
||||
youtube = session.youtube_watch_url
|
||||
links << { label: "YouTube", url: youtube } if youtube.present?
|
||||
links
|
||||
end
|
||||
|
||||
def admin_regia_expires_label(iso_time)
|
||||
return if iso_time.blank?
|
||||
|
||||
Time.zone.parse(iso_time).strftime("%d/%m/%Y %H:%M")
|
||||
rescue ArgumentError, TypeError
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
@@ -61,6 +61,36 @@ module Public
|
||||
"#{match.team.name} #{score_state.home_points} - #{score_state.away_points} #{match.opponent_name}"
|
||||
end
|
||||
|
||||
def live_scorebug_columns(score_state)
|
||||
unless score_state
|
||||
return {
|
||||
labels: ["1"],
|
||||
home: ["0"],
|
||||
away: ["0"],
|
||||
live_index: 0
|
||||
}
|
||||
end
|
||||
|
||||
partials = Array(score_state.set_partials)
|
||||
labels = partials.map { |p| (p["set"] || p[:set]).to_s }
|
||||
home = partials.map { |p| (p["home"] || p[:home]).to_s }
|
||||
away = partials.map { |p| (p["away"] || p[:away]).to_s }
|
||||
labels << score_state.current_set.to_s
|
||||
home << score_state.home_points.to_s
|
||||
away << score_state.away_points.to_s
|
||||
{
|
||||
labels: labels,
|
||||
home: home,
|
||||
away: away,
|
||||
live_index: labels.length - 1
|
||||
}
|
||||
end
|
||||
|
||||
def live_scorebug_team_label(name, max: 16)
|
||||
n = name.to_s
|
||||
n.length <= max ? n : "#{n[0, max - 1]}…"
|
||||
end
|
||||
|
||||
# Colore ospite sul tabellone: secondario società se leggibile su bianco, altrimenti blu visitatore.
|
||||
def live_scorebug_away_color(team)
|
||||
club = team.club
|
||||
|
||||
Reference in New Issue
Block a user