Aggiunge copertina sponsor custom solo Premium Full, con override in wizard e slate sui nodi di streaming.

Permette upload da portale e app con ereditarietà partita→squadra→società, generazione MP4 via ffmpeg e distribuzione su home lab e nodi CPX per pause e assenza segnale.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-19 23:47:17 +02:00
co-authored by Cursor
parent a51d5e8da5
commit 41d4235258
62 changed files with 1487 additions and 20 deletions
@@ -2,6 +2,7 @@ module Api
module V1
class MatchesController < BaseController
include Api::UrlHelper
include Api::CoverJson
include BrandingAttachments
before_action :set_team, only: %i[index create]
@@ -21,6 +22,7 @@ module Api
normalize_scoring_rules!(attrs)
match = @team.matches.create!(attrs)
attach_opponent_logo(match)
attach_match_cover(match)
render json: match_json(match), status: :created
end
@@ -34,6 +36,7 @@ module Api
normalize_opponent_color!(attrs)
@match.update!(attrs)
attach_opponent_logo(@match)
attach_match_cover(@match)
render json: match_json(@match)
end
@@ -98,6 +101,11 @@ module Api
match.opponent_logo_file.attach(file) if file.present?
end
def attach_match_cover(match)
attach_cover_image(match, entitlements: match.team.entitlements)
enqueue_cover_slate_generation(match)
end
def match_json(match, detail: false)
active = active_session_for(match)
team = match.team
@@ -123,6 +131,7 @@ module Api
home_logo_url: api_absolute_url(team.effective_logo_url),
opponent_primary_color: match.effective_opponent_primary_color,
opponent_logo_url: api_absolute_url(match.opponent_logo_url),
**match_cover_json(match),
active_session_id: active&.id,
active_session_status: active&.status,
stream_completed: match.stream_completed?,
@@ -137,7 +137,8 @@ module Api
youtube_mode: ent.plan.youtube_mode,
staff_role: current_user.staff_role_for(team),
can_stream: current_user.can_stream_for?(team),
can_connect_youtube: team.club.owned_by?(current_user) && ent.premium_full? && ent.youtube_enabled?
can_connect_youtube: team.club.owned_by?(current_user) && ent.premium_full? && ent.youtube_enabled?,
custom_cover_enabled: ent.can_use_custom_cover?
}
if detail
data[:members] = team.user_teams.includes(:user).where.not(role: "owner").map do |ut|