CC-1665: Scheduled stream rebroadcasting and recording
-remove some hardcoded webstream values -fix some broken problems from devel
This commit is contained in:
parent
fbc5b72f14
commit
ccdc06786d
2 changed files with 27 additions and 9 deletions
|
@ -2,34 +2,52 @@
|
|||
|
||||
class Application_Model_Webstream{
|
||||
|
||||
public static function getName(){
|
||||
public static function getName()
|
||||
{
|
||||
return "Default";
|
||||
}
|
||||
|
||||
public static function getId(){
|
||||
public static function getId()
|
||||
{
|
||||
return "id";
|
||||
}
|
||||
|
||||
public static function getLastModified($p_type){
|
||||
public static function getLastModified($p_type)
|
||||
{
|
||||
return "modified";
|
||||
}
|
||||
|
||||
public static function getDefaultLength(){
|
||||
public static function getDefaultLength()
|
||||
{
|
||||
return "length";
|
||||
}
|
||||
|
||||
public static function getDescription(){
|
||||
public static function getDescription()
|
||||
{
|
||||
return "desc";
|
||||
}
|
||||
|
||||
public static function save($request){
|
||||
public static function save($request)
|
||||
{
|
||||
Logging::log($request->getParams());
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
Logging::log($userInfo);
|
||||
|
||||
$length = trim($request->getParam("length"));
|
||||
preg_match("/^([0-9]{1,2})h ([0-5][0-9])m$/", $length, $matches);
|
||||
$hours = $matches[1];
|
||||
$minutes = $matches[2];
|
||||
$di = new DateInterval("PT{$hours}H{$minutes}M");
|
||||
$dblength = $di->format("%H:%I");
|
||||
|
||||
#TODO: These should be validated by a Zend Form.
|
||||
$webstream = new CcWebstream();
|
||||
$webstream->setDbName($request->getParam("name"));
|
||||
$webstream->setDbDescription($request->getParam("description"));
|
||||
$webstream->setDbUrl($request->getParam("url"));
|
||||
$webstream->setDbLength("00:05:00");
|
||||
$webstream->setDbLogin("xxx");
|
||||
|
||||
$webstream->setDbLength($dblength);
|
||||
$webstream->setDbLogin($userInfo->id);
|
||||
$webstream->setDbUtime(new DateTime());
|
||||
$webstream->setDbMtime(new DateTime());
|
||||
$webstream->save();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue