Merge branch 'cc-5709-airtime-analyzer' into saas
This commit is contained in:
commit
4f7f64af7a
|
@ -355,13 +355,8 @@ SQL;
|
||||||
{
|
{
|
||||||
$exists = false;
|
$exists = false;
|
||||||
try {
|
try {
|
||||||
//Explicitly check filepath because if it's blank, getFilePath() can
|
$filePath = $this->getFilePath();
|
||||||
//still return a directory that exists.
|
$exists = (file_exists($this->getFilePath()) && !is_dir($filePath));
|
||||||
if (!$this->_file->getDbFilepath()) {
|
|
||||||
$exists = false;
|
|
||||||
} else {
|
|
||||||
$exists = file_exists($this->getFilePath());
|
|
||||||
}
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -504,11 +499,15 @@ SQL;
|
||||||
$music_dir = Application_Model_MusicDir::getDirByPK($this->
|
$music_dir = Application_Model_MusicDir::getDirByPK($this->
|
||||||
_file->getDbDirectory());
|
_file->getDbDirectory());
|
||||||
if (!$music_dir) {
|
if (!$music_dir) {
|
||||||
throw new Exception("Invalid music_dir for file in database.");
|
throw new Exception(_("Invalid music_dir for file in database."));
|
||||||
}
|
}
|
||||||
|
|
||||||
$directory = $music_dir->getDirectory();
|
$directory = $music_dir->getDirectory();
|
||||||
$filepath = $this->_file->getDbFilepath();
|
$filepath = $this->_file->getDbFilepath();
|
||||||
|
if (!$filepath) {
|
||||||
|
throw new Exception(sprintf(_("Blank file path for file %s (id: %s) in database."), $this->_file->getDbTrackTitle(), $this->getId()));
|
||||||
|
}
|
||||||
|
|
||||||
return Application_Common_OsPath::join($directory, $filepath);
|
return Application_Common_OsPath::join($directory, $filepath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -280,8 +280,7 @@ class Rest_MediaController extends Zend_Rest_Controller
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$id = $this->getId();
|
$id = $this->getId();
|
||||||
if (!$id) {
|
if (!$id) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue