CC-5254 : Listener Status for SHOUTcast doesn't work

This commit is contained in:
Naomi Aro 2013-06-24 17:24:43 -04:00
parent 3858371b16
commit c5221aae6a
2 changed files with 35 additions and 29 deletions

View file

@ -70,12 +70,11 @@ class ListenerstatController extends Zend_Controller_Action
$starts_epoch = $request->getParam("startTimestamp", $current_time - (60*60*24)); $starts_epoch = $request->getParam("startTimestamp", $current_time - (60*60*24));
$ends_epoch = $request->getParam("endTimestamp", $current_time); $ends_epoch = $request->getParam("endTimestamp", $current_time);
$mountName = $request->getParam("mountName", null);
$startsDT = DateTime::createFromFormat("U", $starts_epoch, new DateTimeZone("UTC")); $startsDT = DateTime::createFromFormat("U", $starts_epoch, new DateTimeZone("UTC"));
$endsDT = DateTime::createFromFormat("U", $ends_epoch, new DateTimeZone("UTC")); $endsDT = DateTime::createFromFormat("U", $ends_epoch, new DateTimeZone("UTC"));
$data = Application_Model_ListenerStat::getDataPointsWithinRange($startsDT->format("Y-m-d H:i:s"), $endsDT->format("Y-m-d H:i:s"), $mountName); $data = Application_Model_ListenerStat::getDataPointsWithinRange($startsDT->format("Y-m-d H:i:s"), $endsDT->format("Y-m-d H:i:s"));
$this->_helper->json->sendJson($data); $this->_helper->json->sendJson($data);
} }
} }

View file

@ -62,6 +62,13 @@ SQL;
if (isset($out[$enabledMountPoint])) { if (isset($out[$enabledMountPoint])) {
$enabledOut[$enabledMountPoint] = $out[$enabledMountPoint]; $enabledOut[$enabledMountPoint] = $out[$enabledMountPoint];
} }
else {
//TODO fix this hack (here for CC-5254)
//all shoutcast streams are automatically put under "shoutcast" mount point.
if (isset($out["shoutcast"])) {
$enabledOut["shoutcast"] = $out["shoutcast"];
}
}
} }
return $enabledOut; return $enabledOut;