Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
6848963904
7 changed files with 44 additions and 6 deletions
|
@ -315,6 +315,8 @@ class ApiController extends Zend_Controller_Action
|
|||
|
||||
$upload_dir = ini_get("upload_tmp_dir");
|
||||
StoredFile::uploadFile($upload_dir);
|
||||
$fileName = isset($_REQUEST["name"]) ? $_REQUEST["name"] : '';
|
||||
StoredFile::copyFileToStor($upload_dir, $fileName);
|
||||
}
|
||||
|
||||
public function uploadRecordedAction()
|
||||
|
|
|
@ -7,6 +7,7 @@ class PluploadController extends Zend_Controller_Action
|
|||
{
|
||||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||
$ajaxContext->addActionContext('upload', 'json')
|
||||
->addActionContext('copyfile', 'json')
|
||||
->initContext();
|
||||
}
|
||||
|
||||
|
@ -29,6 +30,14 @@ class PluploadController extends Zend_Controller_Action
|
|||
|
||||
die('{"jsonrpc" : "2.0"}');
|
||||
}
|
||||
|
||||
public function copyfileAction(){
|
||||
$upload_dir = ini_get("upload_tmp_dir") . DIRECTORY_SEPARATOR . "plupload";
|
||||
$filename = $this->_getParam('name');
|
||||
StoredFile::copyFileToStor($upload_dir, $filename);
|
||||
|
||||
die('{"jsonrpc" : "2.0"}');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -795,7 +795,7 @@ class StoredFile {
|
|||
die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": "Failed to open output stream."}, "id" : "id"}');
|
||||
}
|
||||
|
||||
$audio_file = $p_targetDir . DIRECTORY_SEPARATOR . $fileName;
|
||||
/*$audio_file = $p_targetDir . DIRECTORY_SEPARATOR . $fileName;
|
||||
|
||||
$md5 = md5_file($audio_file);
|
||||
$duplicate = StoredFile::RecallByMd5($md5);
|
||||
|
@ -816,9 +816,34 @@ class StoredFile {
|
|||
|
||||
$audio_stor = $stor . DIRECTORY_SEPARATOR . $fileName;
|
||||
|
||||
$r = @copy($audio_file, $audio_stor);
|
||||
$r = @copy($audio_file, $audio_stor);*/
|
||||
|
||||
}
|
||||
|
||||
public static function copyFileToStor($p_targetDir, $fileName){
|
||||
$audio_file = $p_targetDir . DIRECTORY_SEPARATOR . $fileName;
|
||||
|
||||
$md5 = md5_file($audio_file);
|
||||
$duplicate = StoredFile::RecallByMd5($md5);
|
||||
if ($duplicate) {
|
||||
if (PEAR::isError($duplicate)) {
|
||||
die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": ' . $duplicate->getMessage() .'}}');
|
||||
}
|
||||
if (file_exists($duplicate->getFilePath())) {
|
||||
$duplicateName = $duplicate->getMetadataValue('MDATA_KEY_TITLE');
|
||||
die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "An identical audioclip named ' . $duplicateName . ' already exists in the storage server."}}');
|
||||
}
|
||||
}
|
||||
|
||||
$storDir = MusicDir::getStorDir();
|
||||
$stor = $storDir->getDirectory();
|
||||
|
||||
$stor .= "/organize";
|
||||
|
||||
$audio_stor = $stor . DIRECTORY_SEPARATOR . $fileName;
|
||||
|
||||
$r = @copy($audio_file, $audio_stor);
|
||||
}
|
||||
|
||||
public static function getFileCount()
|
||||
{
|
||||
|
|
|
@ -5,6 +5,7 @@ $(document).ready(function() {
|
|||
// General settings
|
||||
runtimes : 'html5,html4',
|
||||
url : '/Plupload/upload/format/json',
|
||||
chunk_size: '5mb',
|
||||
multiple_queues : 'true',
|
||||
filters : [
|
||||
{title: "Audio Files", extensions: "ogg,mp3"}
|
||||
|
@ -24,6 +25,7 @@ $(document).ready(function() {
|
|||
|
||||
$("#plupload_error").find("table").append(row);
|
||||
}
|
||||
$.get('/Plupload/copyfile/format/json/name/'+file.name);
|
||||
});
|
||||
|
||||
var uploadProgress = false;
|
||||
|
|
|
@ -37,9 +37,6 @@ if [ "$?" -ne "0" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
#install virtualenv 1.6.3
|
||||
easy_install virtualenv==1.6.3
|
||||
|
||||
# Install phing
|
||||
sudo pear channel-discover pear.phing.info
|
||||
sudo pear install phing/phing-2.4.2
|
||||
|
|
BIN
install_minimal/3rd_party/distribute-0.6.10.tar.gz
vendored
Normal file
BIN
install_minimal/3rd_party/distribute-0.6.10.tar.gz
vendored
Normal file
Binary file not shown.
|
@ -15,7 +15,10 @@ if [ ! -d "$VIRTUAL_ENV_DIR" ]; then
|
|||
if [ "$?" -eq "0" ]; then
|
||||
sudo virtualenv --extra-search-dir=${SCRIPTPATH}/3rd_party --no-site-package -p /usr/bin/python2.6 /usr/lib/airtime/airtime_virtualenv
|
||||
else
|
||||
sudo virtualenv --distribute --no-site-package -p /usr/bin/python2.6 /usr/lib/airtime/airtime_virtualenv
|
||||
# copy distibute-0.6.10.tar.gz to /usr/share/python-virtualenv/
|
||||
# this is due to the bug in virtualenv 1.4.9
|
||||
cp ${SCRIPTPATH}/3rd_party/distribute-0.6.10.tar.gz /usr/share/python-virtualenv/
|
||||
sudo virtualenv --no-site-package -p /usr/bin/python2.6 /usr/lib/airtime/airtime_virtualenv
|
||||
fi
|
||||
|
||||
echo -e "\n*** Installing Python Libraries ***"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue