CC-3975: Media Library: Try to download files from watched folder, the filename will be "true"
-fixed
This commit is contained in:
parent
f029124447
commit
1300593e8b
|
@ -125,18 +125,17 @@ class ApiController extends Zend_Controller_Action
|
||||||
$media = Application_Model_StoredFile::RecallByGunid($file_id);
|
$media = Application_Model_StoredFile::RecallByGunid($file_id);
|
||||||
if ( $media != null )
|
if ( $media != null )
|
||||||
{
|
{
|
||||||
$dir = Application_Model_MusicDir::getDirByPK($media->getDirectory());
|
|
||||||
|
|
||||||
$filepath = $media->getFilePath();
|
$filepath = $media->getFilePath();
|
||||||
if(is_file($filepath)){
|
if(is_file($filepath)){
|
||||||
$full_path = $media->getPropelOrm()->getDbFilepath();
|
$full_path = $media->getPropelOrm()->getDbFilepath();
|
||||||
|
|
||||||
if (strcmp($dir->getType(), 'watched') != 0) {
|
|
||||||
$file_base_name = strrchr($full_path, '/');
|
$file_base_name = strrchr($full_path, '/');
|
||||||
$file_base_name = substr($file_base_name, 1);
|
if (!$file_base_name) {
|
||||||
} else {
|
|
||||||
$file_base_name = $full_path;
|
$file_base_name = $full_path;
|
||||||
}
|
}
|
||||||
|
$file_base_name = substr($file_base_name, 1);
|
||||||
|
|
||||||
// possibly use fileinfo module here in the future.
|
// possibly use fileinfo module here in the future.
|
||||||
// http://www.php.net/manual/en/book.fileinfo.php
|
// http://www.php.net/manual/en/book.fileinfo.php
|
||||||
$ext = pathinfo($fileID, PATHINFO_EXTENSION);
|
$ext = pathinfo($fileID, PATHINFO_EXTENSION);
|
||||||
|
|
Loading…
Reference in New Issue