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
@@ -0,0 +1,38 @@
require "rails_helper"
RSpec.describe Streams::CoverSlateEnsurer do
let!(:club) { Club.create!(name: "Club", sport: "volleyball", primary_color: "#e53935", secondary_color: "#ffffff") }
let!(:team) { club.teams.create!(name: "Team", sport: "volleyball") }
let!(:match) { team.matches.create!(opponent_name: "Opp", sport: "volleyball") }
before do
load Rails.root.join("db/seeds/plans.rb")
Billing::AssignPlan.call(club: club, plan_slug: "premium_full")
match.cover_image.attach(
io: StringIO.new("img"),
filename: "c.png",
content_type: "image/png"
)
end
it "genera in sync se manca cover_slate" do
expect(Streams::GenerateCoverSlate).to receive(:call).with(match).and_return(match)
described_class.ensure_for!(match)
end
it "non rigenera se slate pronta su disco" do
match.cover_slate.attach(
io: StringIO.new("mp4"),
filename: "s.mp4",
content_type: "video/mp4"
)
path = Streams::CoverSlatePaths.expected_path(match)
FileUtils.mkdir_p(File.dirname(path))
File.write(path, "fake")
expect(Streams::GenerateCoverSlate).not_to receive(:call)
described_class.ensure_for!(match)
ensure
FileUtils.rm_f(path) if defined?(path) && path
end
end