From 4526113a192f730f95658a12700c63c076bca58b Mon Sep 17 00:00:00 2001 From: Daniel Neto Date: Fri, 17 Jan 2025 10:49:42 -0300 Subject: [PATCH] Update --- plugin/Live/Live.php | 21 ++++++++------------- plugin/Live/Objects/Live_schedule.php | 6 ++++++ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/plugin/Live/Live.php b/plugin/Live/Live.php index 47e46ae1b33d..eaec1fcb4985 100644 --- a/plugin/Live/Live.php +++ b/plugin/Live/Live.php @@ -1282,8 +1282,8 @@ public function getStatsObject($live_servers_id = 0, $force_recreate = false, $t { global $global, $_getStatsObject_force_recreate_executed; - if ($force_recreate) { - if (!empty($_getStatsObject_force_recreate_executed)) { + if($force_recreate){ + if(!empty($_getStatsObject_force_recreate_executed)){ // already forced, ignore it $force_recreate = false; } @@ -1332,9 +1332,9 @@ public function getStatsObject($live_servers_id = 0, $force_recreate = false, $t $xml = $this->createCacheStatsObject($live_servers_id, $o->requestStatsTimout); $getStatsObject[$live_servers_id] = $xml; $cacheHandler->setCache($xml); - + if (!empty($force_recreate) || !empty($_REQUEST['debug'])) { - _error_log("Live::getStatsObject[$live_servers_id] 5: forced to be recreated done " . json_encode(debug_backtrace())); + _error_log("Live::getStatsObject[$live_servers_id] 5: forced to be recreated done ".json_encode(debug_backtrace())); } //var_dump(__LINE__, $xml); $global['isStatsAccessible'][$live_servers_id] = !empty($xml); @@ -1989,12 +1989,7 @@ public static function isRebroadcast($key) $_isRebroadcast = array(); } if (!isset($_isRebroadcast[$key])) { - $parts = explode("_", $key); - if (empty($parts[0])) { - return false; - } - $livet = LiveTransmition::keyExists($parts[0]); - $lt = new LiveTransmition($livet['id']); + $lt = self::getLiveTransmitionObjectFromKey($key); if (empty($lt)) { $_isRebroadcast[$key] = false; } else { @@ -3673,7 +3668,7 @@ public static function getValidNotOnlineLiveIndex($key, $live_index) if (empty($live_index)) { return 1; } - if (AVideoPlugin::isEnabled('VideoPlaylistScheduler') && VideoPlaylistScheduler::iskeyShowScheduled("$key-$live_index")) { + if(AVideoPlugin::isEnabled('VideoPlaylistScheduler') && VideoPlaylistScheduler::iskeyShowScheduled("$key-$live_index")){ // it is a VideoPlaylistScheduler do not change it return $live_index; } @@ -4154,7 +4149,7 @@ public static function _getUserNotificationButton() { $obj = AVideoPlugin::getDataObject('Live'); if (Live::canScheduleLive()) { -?> + ?> @@ -4223,7 +4218,7 @@ public function on_publish_done($live_transmitions_history_id, $users_id, $key, $obj->live_key = $key; $obj->live_servers_id = intval($live_servers_id); $obj->sendSocketMessage = sendSocketMessage(array('redirectLive' => $obj), 'redirectLive', 0); - _error_log('on_publish_done::redirectLive ' . json_encode($obj)); + _error_log('on_publish_done::redirectLive '.json_encode($obj)); } } } diff --git a/plugin/Live/Objects/Live_schedule.php b/plugin/Live/Objects/Live_schedule.php index 13beb727e123..03d396d6eb3d 100644 --- a/plugin/Live/Objects/Live_schedule.php +++ b/plugin/Live/Objects/Live_schedule.php @@ -579,4 +579,10 @@ public function isAPrivateLive(){ return !empty($lt->getGroups()); } + public function getIsRebroadcast() { + $ltRow = LiveTransmition::getFromDbByUser($this->getUsers_id()); + $lt = new LiveTransmition($ltRow['id']); + return !empty($lt->getIsRebroadcast()); + } + }