CC-2494: Uploading songs getting a 500 error (shows as yellow ! in the UI)

-fixed
-also made it so that files deleted via the UI are deleted on the FS as well.
This commit is contained in:
martin 2011-07-06 13:54:52 -04:00
parent 9594dd7078
commit 3d52db5211
5 changed files with 36 additions and 16 deletions

View file

@ -133,6 +133,10 @@ class LibraryController extends Zend_Controller_Action
$this->view->message = "file doesn't exist";
return;
}
$data = array("filepath"=>$file->getFilePath());
RabbitMq::SendMessageToMediaMonitor("file_delete", $data);
$res = $file->delete();

View file

@ -102,11 +102,10 @@ class MusicDir {
->findOne();
$mus_dir = new MusicDir($dir);
$mus_dir->_dir = $dir;
return $mus_dir;
}
}
public static function setStorDir($p_dir)
{
$dir = self::getStorDir();

View file

@ -813,6 +813,8 @@ class StoredFile {
$storDir = MusicDir::getStorDir();
$stor = $storDir->getDirectory();
$stor .= "/organize";
$audio_stor = $stor . DIRECTORY_SEPARATOR . $fileName;
$r = @copy($audio_file, $audio_stor);