feat: move storage path setting to configuration file

- change default storage path to /srv/libretime
- remove music dirs table
- use /tmp for testing storage
- storage dir should always have a trailing slash
This commit is contained in:
jo 2022-04-18 20:34:38 +02:00 committed by Kyle Robbertze
parent b3ff2defc4
commit f7bb6e7592
48 changed files with 464 additions and 4701 deletions

View file

@ -380,58 +380,6 @@ class PreferenceController extends Zend_Controller_Action
$this->_helper->json->sendJson($result);
}
public function changeStorDirectoryAction()
{
$chosen = $this->getRequest()->getParam('dir');
$element = $this->getRequest()->getParam('element');
$watched_dirs_form = new Application_Form_WatchedDirPreferences();
$res = Application_Model_MusicDir::setStorDir($chosen);
if ($res['code'] != 0) {
$watched_dirs_form->populate(['storageFolder' => $chosen]);
$watched_dirs_form->getElement($element)->setErrors([$res['error']]);
}
$this->view->subform = $watched_dirs_form->render();
}
public function reloadWatchDirectoryAction()
{
$chosen = $this->getRequest()->getParam('dir');
$element = $this->getRequest()->getParam('element');
$watched_dirs_form = new Application_Form_WatchedDirPreferences();
$res = Application_Model_MusicDir::addWatchedDir($chosen);
if ($res['code'] != 0) {
$watched_dirs_form->populate(['watchedFolder' => $chosen]);
$watched_dirs_form->getElement($element)->setErrors([$res['error']]);
}
$this->view->subform = $watched_dirs_form->render();
}
public function rescanWatchDirectoryAction()
{
$dir_path = $this->getRequest()->getParam('dir');
$dir = Application_Model_MusicDir::getDirByPath($dir_path);
$data = ['directory' => $dir->getDirectory(),
'id' => $dir->getId(), ];
Application_Model_RabbitMq::SendMessageToMediaMonitor('rescan_watch', $data);
Logging::info("Unhiding all files belonging to:: {$dir_path}");
$dir->unhideFiles();
$this->_helper->json->sendJson(null);
}
public function removeWatchDirectoryAction()
{
$chosen = $this->getRequest()->getParam('dir');
$dir = Application_Model_MusicDir::removeWatchedDir($chosen);
$watched_dirs_form = new Application_Form_WatchedDirPreferences();
$this->view->subform = $watched_dirs_form->render();
}
public function isImportInProgressAction()
{
$now = time();