CC-3174 : showbuilder
checking to make sure UI is up to date with db
This commit is contained in:
parent
e1d5d6de73
commit
b2d0565ec4
4 changed files with 103 additions and 57 deletions
|
@ -850,14 +850,14 @@ class Application_Model_StoredFile {
|
|||
//check to see if we have enough space in the /organize directory to copy the file
|
||||
$freeSpace = disk_free_space($destination_folder);
|
||||
$fileSize = filesize($audio_file);
|
||||
|
||||
|
||||
if ( $freeSpace < $fileSize ){
|
||||
$freeSpace = floor($freeSpace/1024/1024);
|
||||
$fileSize = floor($fileSize/1024/1024);
|
||||
die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "The file was not uploaded, there was '.$freeSpace.'MB disk space left the file you are uploadings size is '.$fileSize.'MB."}}');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static function copyFileToStor($p_targetDir, $fileName, $tempname){
|
||||
$audio_file = $p_targetDir . DIRECTORY_SEPARATOR . $tempname;
|
||||
Logging::log('copyFileToStor: moving file '.$audio_file);
|
||||
|
@ -875,13 +875,13 @@ class Application_Model_StoredFile {
|
|||
|
||||
$storDir = Application_Model_MusicDir::getStorDir();
|
||||
$stor = $storDir->getDirectory();
|
||||
|
||||
|
||||
//check to see if there is enough space in $stor to continue.
|
||||
Application_Model_StoredFile::checkForEnoughDiskSpaceToCopy($stor, $audio_file);
|
||||
|
||||
$stor .= "/organize";
|
||||
$audio_stor = $stor . DIRECTORY_SEPARATOR . $fileName;
|
||||
|
||||
|
||||
$stor .= "/organize";
|
||||
$audio_stor = $stor . DIRECTORY_SEPARATOR . $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
|
||||
$r = @rename($audio_file, $audio_stor);
|
||||
|
@ -897,7 +897,7 @@ class Application_Model_StoredFile {
|
|||
//$r = @unlink($audio_file);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static function getFileCount()
|
||||
{
|
||||
global $CC_CONFIG, $CC_DBC;
|
||||
|
@ -1028,3 +1028,4 @@ class Application_Model_StoredFile {
|
|||
}
|
||||
|
||||
class DeleteScheduledFileException extends Exception {}
|
||||
class FileDoesNotExistException extends Exception {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue