From 3ef3c59d94ddc39df91e48c3bf2acfa7278443d8 Mon Sep 17 00:00:00 2001 From: Emiliano Frascaro Date: Thu, 4 Jun 2026 09:45:05 +0200 Subject: [PATCH] PublisherSync: rileva publisher anche con source RTMP attivo Co-authored-by: Cursor --- backend/app/services/mediamtx/publisher_sync.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/backend/app/services/mediamtx/publisher_sync.rb b/backend/app/services/mediamtx/publisher_sync.rb index 3e20de0..3a00259 100644 --- a/backend/app/services/mediamtx/publisher_sync.rb +++ b/backend/app/services/mediamtx/publisher_sync.rb @@ -10,7 +10,7 @@ module Mediamtx return @session if @session.terminal? info = Mediamtx::Client.new.list_paths.find { |i| i["name"] == @session.mediamtx_path_name } - publisher_online = info && info["online"] + publisher_online = publisher_online?(info) if publisher_online if @session.paused? @@ -35,6 +35,15 @@ module Mediamtx private + def publisher_online?(info) + return false unless info + + return true if info["online"] + return true if info["source"].present? + + false + end + def cancel_timeout return if @session.timeout_job_id.blank?