CC-2524:MusicDir.php: adding error handling

- following functions now handle error and return code and
error message if there is an error:
addDir(), setStorDir(), removeWatchedDir()
- fixed airtime-importy.py to work with new MusicDir functions
This commit is contained in:
james 2011-07-11 14:00:31 -04:00
parent ece84a04c5
commit e47f80802e
4 changed files with 48 additions and 23 deletions

View file

@ -569,7 +569,7 @@ class ApiController extends Zend_Controller_Action
exit;
}
$this->view = MusicDir::addWatchedDir($path);
$this->view->msg = MusicDir::addWatchedDir($path);
}
public function removeWatchedDirAction() {
@ -586,8 +586,7 @@ class ApiController extends Zend_Controller_Action
exit;
}
$dir = MusicDir::getDirByPath($path);
$this->view = $dir->remove();
$this->view->msg = MusicDir::removeWatchedDir($path);
}
public function setStorageDirAction() {
@ -603,8 +602,8 @@ class ApiController extends Zend_Controller_Action
print 'You are not allowed to access this resource.';
exit;
}
MusicDir::setStorDir($path);
$this->view = MusicDir::getStorDir()->getDirectory();
$this->view->msg = MusicDir::setStorDir($path);
}
}