Fixes to the liquidsoap scheduler and the API.
Added a test() function to api_client. Fixed bug with the config file. Added line numbers to the logging.
This commit is contained in:
parent
d5b50ffdca
commit
7ade83ae74
10 changed files with 151 additions and 68 deletions
|
@ -418,7 +418,7 @@ class Schedule {
|
|||
}
|
||||
|
||||
$result = array();
|
||||
$result['status'] = array('range' => $range_dt, 'version' => 0.2);
|
||||
$result['status'] = array('range' => $range_dt, 'version' => "0.2");
|
||||
$result['playlists'] = $playlists;
|
||||
$result['check'] = 1;
|
||||
|
||||
|
|
|
@ -953,7 +953,7 @@ class StoredFile {
|
|||
$values = array(
|
||||
"id" => $p_nid,
|
||||
"filename" => $p_src->name,
|
||||
"filepath" => $p_src->getRealFileName(),
|
||||
"filepath" => $p_src->getRealFilePath(),
|
||||
"filetype" => $p_src->getType()
|
||||
);
|
||||
$storedFile = StoredFile::Insert($values);
|
||||
|
@ -1028,7 +1028,7 @@ class StoredFile {
|
|||
*/
|
||||
public function accessRawMediaData($p_parent='0')
|
||||
{
|
||||
$realFname = $this->getRealFileName();
|
||||
$realFname = $this->getRealFilePath();
|
||||
$ext = $this->getFileExtension();
|
||||
$res = BasicStor::bsAccess($realFname, $ext, $this->gunid, 'access', $p_parent);
|
||||
if (PEAR::isError($res)) {
|
||||
|
@ -1679,13 +1679,17 @@ class StoredFile {
|
|||
// return $resDir;
|
||||
// }
|
||||
|
||||
public function getRealFileName()
|
||||
{
|
||||
return $this->gunid.".".$this->getFileExtension();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get real filename of raw media data
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRealFileName()
|
||||
public function getRealFilePath()
|
||||
{
|
||||
return $this->filepath;
|
||||
}
|
||||
|
@ -1697,7 +1701,7 @@ class StoredFile {
|
|||
{
|
||||
global $CC_CONFIG;
|
||||
return "http://".$CC_CONFIG["storageUrlHost"]
|
||||
."api/get_media.php?file_id={$this->gunid}";
|
||||
.$CC_CONFIG["apiPath"]."get_media.php?file={$this->getRealFileName()}";
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -300,7 +300,7 @@ class Transport
|
|||
return $mdtrec;
|
||||
}
|
||||
// handle raw media file:
|
||||
$fpath = $storedFile->getRealFileName();
|
||||
$fpath = $storedFile->getRealFilePath();
|
||||
if (PEAR::isError($fpath)) {
|
||||
return $fpath;
|
||||
}
|
||||
|
|
|
@ -7,17 +7,16 @@ require_once(dirname(__FILE__).'/../../conf.php');
|
|||
require_once('DB.php');
|
||||
require_once('PHPUnit.php');
|
||||
require_once 'StoredFileTests.php';
|
||||
//require_once 'SchedulerTests.php';
|
||||
require_once 'SchedulerTests.php';
|
||||
//require_once 'SchedulerExportTests.php';
|
||||
require_once 'PlaylistTests.php';
|
||||
|
||||
//$suite = new PHPUnit_TestSuite("PlayListTests");
|
||||
$suite = new PHPUnit_TestSuite("StoredFileTest");
|
||||
//$suite = new PHPUnit_TestSuite("SchedulerTests");
|
||||
//$suite->addTestSuite("BasicStorTest");
|
||||
//$suite->addTestSuite("SchedulerTests");
|
||||
//$suite->addTestSuite("SchedulerExportTests");
|
||||
$suite = new PHPUnit_TestSuite("StoredFileTest");
|
||||
$suite->addTestSuite("PlaylistTests");
|
||||
$suite->addTestSuite("SchedulerTests");
|
||||
//$suite->addTestSuite("SchedulerExportTests");
|
||||
$result = PHPUnit::run($suite);
|
||||
|
||||
echo $result->toString();
|
||||
|
|
|
@ -83,11 +83,5 @@ class StoredFileTest extends PHPUnit_TestCase {
|
|||
|
||||
}
|
||||
|
||||
function testFoo() {
|
||||
// Add a file
|
||||
$values = array("filepath" => dirname(__FILE__)."/test10001.mp3");
|
||||
$this->storedFile = StoredFile::Insert($values, false);
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue