CC-3975: Media Library: Try to download files from watched folder, the filename will be "true"

-fixed
This commit is contained in:
denise 2012-06-15 16:48:51 -04:00
parent b0e93005e5
commit 186b8ef1c2
2 changed files with 16 additions and 4 deletions

View file

@ -125,11 +125,18 @@ class ApiController extends Zend_Controller_Action
$media = Application_Model_StoredFile::RecallByGunid($file_id);
if ( $media != null )
{
$dir = Application_Model_MusicDir::getDirByPK($media->getDirectory());
$filepath = $media->getFilePath();
if(is_file($filepath)){
$full_path = $media->getPropelOrm()->getDbFilepath();
$file_base_name = strrchr($full_path, '/');
$file_base_name = substr($file_base_name, 1);
if (strcmp($dir->getType(), 'watched') != 0) {
$file_base_name = strrchr($full_path, '/');
$file_base_name = substr($file_base_name, 1);
} else {
$file_base_name = $full_path;
}
// possibly use fileinfo module here in the future.
// http://www.php.net/manual/en/book.fileinfo.php
$ext = pathinfo($fileID, PATHINFO_EXTENSION);