Integrazione YouTube Live: OAuth squadra, canale piattaforma Light e UI.

Collegamento da Dettagli squadra e admin per il refresh token Match Live TV; API e app mobile allineate ai piani Light/Full.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-02 19:36:56 +02:00
parent 1a84d6ae42
commit 994c1e3c09
28 changed files with 557 additions and 28 deletions

View File

@@ -0,0 +1,44 @@
module Youtube
class TeamStatus
PLATFORM_LABEL = "Match Live TV".freeze
def initialize(team)
@team = team
@ent = team.entitlements
@mode = @ent.plan.youtube_mode
end
def selectable?
return false unless @ent.youtube_enabled?
case @mode
when "matchlivetv_light"
PlatformCredential.configured?
when "team"
@team.youtube_credential.present?
else
false
end
end
def connected?
selectable?
end
def uses_platform_channel?
@mode == "matchlivetv_light" && PlatformCredential.configured?
end
def channel_title
if uses_platform_channel?
PLATFORM_LABEL
else
@team.youtube_credential&.channel_title
end
end
def needs_team_oauth?
@mode == "team" && @ent.premium_full?
end
end
end