Mantiene la copertina YouTube se il telefono cade e avvia ffmpeg sul nodo, non via SSH.

Il relay HLS→RTMPS resta sul worker/agent del nodo assegnato, così tre dirette contemporanee restano in onda sul sito e sul canale della società senza schermo nero.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-16 20:41:46 +02:00
co-authored by Cursor
parent bfb3115a64
commit baa6283a15
36 changed files with 1444 additions and 141 deletions
@@ -0,0 +1,37 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe Youtube::LivePipeline do
let(:user) { User.create!(email: "ytpipe@test.it", name: "U", password: "Password123", role: "coach") }
let(:club) { Club.create!(name: "C", sport: "volleyball", primary_color: "#e53935", secondary_color: "#ffffff") }
let(:team) { club.teams.create!(name: "T", sport: "volleyball") }
let(:match) { team.matches.create!(opponent_name: "Opp", sport: "volleyball") }
let(:session) do
StreamSession.create!(
match: match,
user: user,
platform: "youtube",
status: "live",
youtube_broadcast_id: "bcast",
stream_key: "yt-key"
)
end
let(:client) { instance_double(Mediamtx::Client) }
before do
allow(Mediamtx::Client).to receive(:for_session).and_return(client)
allow(Mediamtx::PublisherOnline).to receive(:active?).and_return(true)
allow(Streams::YoutubeRelay).to receive(:ensure_publishing!)
allow(Streams::YoutubeRelay).to receive(:running?).and_return(true)
allow(described_class).to receive(:schedule!)
allow(described_class).to receive(:schedule_activate!)
allow(client).to receive(:set_always_available)
end
it "non spegne la slate quando il publisher è online" do
described_class.tick_session!(session)
expect(client).not_to have_received(:set_always_available)
end
end