From 1300593e8baefbfbf3382feaa27db614eb3f8cfa Mon Sep 17 00:00:00 2001 From: denise Date: Wed, 27 Jun 2012 13:03:22 -0400 Subject: [PATCH] CC-3975: Media Library: Try to download files from watched folder, the filename will be "true" -fixed --- airtime_mvc/application/controllers/ApiController.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index 07b58c016..03bd6cd6d 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -125,18 +125,17 @@ 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(); - if (strcmp($dir->getType(), 'watched') != 0) { - $file_base_name = strrchr($full_path, '/'); - $file_base_name = substr($file_base_name, 1); - } else { + $file_base_name = strrchr($full_path, '/'); + if (!$file_base_name) { $file_base_name = $full_path; - } + } + $file_base_name = substr($file_base_name, 1); + // possibly use fileinfo module here in the future. // http://www.php.net/manual/en/book.fileinfo.php $ext = pathinfo($fileID, PATHINFO_EXTENSION);