Files
MatchLiveTv/backend/app/services/youtube/credential_resolver.rb
Emiliano Frascaro 994c1e3c09 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>
2026-06-02 19:36:56 +02:00

25 lines
506 B
Ruby

module Youtube
class CredentialResolver
def self.for_team(team)
new(team).resolve
end
def initialize(team)
@team = team
@mode = team.entitlements.plan.youtube_mode
end
def resolve
if @mode == "matchlivetv_light" && PlatformCredential.configured?
PlatformCredential.new
else
@team.youtube_credential
end
end
def uses_platform_channel?
@mode == "matchlivetv_light" && PlatformCredential.configured?
end
end
end