SAAS-863: Streams not disabled properly in Liquidsoap config when downgrading
This commit is contained in:
parent
f4ff00355d
commit
5b6f4ca12a
|
@ -1,5 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
require_once 'StreamSetting.php';
|
||||||
require_once 'Cache.php';
|
require_once 'Cache.php';
|
||||||
|
|
||||||
class Application_Model_Preference
|
class Application_Model_Preference
|
||||||
|
@ -815,6 +816,19 @@ class Application_Model_Preference
|
||||||
public static function SetNumOfStreams($num)
|
public static function SetNumOfStreams($num)
|
||||||
{
|
{
|
||||||
self::setValue("num_of_streams", intval($num));
|
self::setValue("num_of_streams", intval($num));
|
||||||
|
|
||||||
|
//Enable or disable each stream according to whatever was just changed.
|
||||||
|
for ($streamIdx = 1; $streamIdx <= MAX_NUM_STREAMS; $streamIdx++)
|
||||||
|
{
|
||||||
|
$prefix = 's' . $streamIdx . '_';
|
||||||
|
$enable = 'false';
|
||||||
|
if ($streamIdx <= intval($num)) {
|
||||||
|
$enable = 'true';
|
||||||
|
}
|
||||||
|
|
||||||
|
//Enable or disable the stream in the Stream Settings DB table.
|
||||||
|
Application_Model_StreamSetting::setIndividualStreamSetting(array($prefix.'enable' => $enable));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function GetNumOfStreams()
|
public static function GetNumOfStreams()
|
||||||
|
|
|
@ -279,7 +279,7 @@ class Application_Model_StreamSetting
|
||||||
$sql = "UPDATE cc_stream_setting SET value=:v WHERE keyname=:keyname";
|
$sql = "UPDATE cc_stream_setting SET value=:v WHERE keyname=:keyname";
|
||||||
$map = array(":v" => $v, ":keyname"=>$keyname);
|
$map = array(":v" => $v, ":keyname"=>$keyname);
|
||||||
|
|
||||||
$res = Application_Common_Database::prepareAndExecute($sql, $map,
|
$res = Application_Common_Database::prepareAndExecute($sql, $map,
|
||||||
Application_Common_Database::EXECUTE);
|
Application_Common_Database::EXECUTE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue