Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
18caafac48
4 changed files with 33 additions and 3 deletions
|
@ -42,4 +42,25 @@ class Application_Common_OsPath{
|
|||
else
|
||||
return '.';
|
||||
}
|
||||
|
||||
/* Similar to the os.path.join python method
|
||||
* http://stackoverflow.com/a/1782990/276949 */
|
||||
function join() {
|
||||
$args = func_get_args();
|
||||
$paths = array();
|
||||
|
||||
foreach($args as $arg) {
|
||||
$paths = array_merge($paths, (array)$arg);
|
||||
}
|
||||
|
||||
foreach($paths as &$path) {
|
||||
$path = trim($path, DIRECTORY_SEPARATOR);
|
||||
}
|
||||
|
||||
if (substr($args[0], 0, 1) == DIRECTORY_SEPARATOR) {
|
||||
$paths[0] = DIRECTORY_SEPARATOR . $paths[0];
|
||||
}
|
||||
|
||||
return join(DIRECTORY_SEPARATOR, $paths);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -224,7 +224,7 @@ class Application_Model_ShowBuilder {
|
|||
$this->getScheduledStatus($startsEpoch, min($endsEpoch, $showEndEpoch), $row);
|
||||
|
||||
$row["id"] = intval($p_item["sched_id"]);
|
||||
$row["image"] = $p_item["file_exists"] == "t" ? true : false;
|
||||
$row["image"] = $p_item["file_exists"];
|
||||
$row["instance"] = intval($p_item["si_id"]);
|
||||
$row["starts"] = $schedStartDT->format("H:i:s");
|
||||
$row["ends"] = $schedEndDT->format("H:i:s");
|
||||
|
|
|
@ -841,8 +841,7 @@ Logging::log("getting media! - 2");
|
|||
//check to see if there is enough space in $stor to continue.
|
||||
$enough_space = Application_Model_StoredFile::checkForEnoughDiskSpaceToCopy($stor, $audio_file);
|
||||
if ($enough_space){
|
||||
$stor .= "/organize";
|
||||
$audio_stor = $stor . DIRECTORY_SEPARATOR . $fileName;
|
||||
$audio_stor = Application_Common_OsPath::join($stor, "organize", $fileName);
|
||||
|
||||
Logging::log("copyFileToStor: moving file $audio_file to $audio_stor");
|
||||
//Martin K.: changed to rename: Much less load + quicker since this is an atomic operation
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue