SAAS-863: Streams not disabled properly in Liquidsoap config when downgrading

This commit is contained in:
Albert Santoni 2015-06-15 12:19:03 -04:00
parent f4ff00355d
commit 5b6f4ca12a
2 changed files with 15 additions and 1 deletions

View File

@ -1,5 +1,6 @@
<?php
require_once 'StreamSetting.php';
require_once 'Cache.php';
class Application_Model_Preference
@ -815,6 +816,19 @@ class Application_Model_Preference
public static function SetNumOfStreams($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()