CC-2717: Media Monitor forgets about watched directories after being restarted
This commit is contained in:
parent
e5579228bd
commit
d7830785df
|
@ -426,6 +426,13 @@ class ApiController extends Zend_Controller_Action
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->view->stor = MusicDir::getStorDir()->getDirectory();
|
$this->view->stor = MusicDir::getStorDir()->getDirectory();
|
||||||
|
|
||||||
|
$watchedDirs = MusicDir::getWatchedDirs();
|
||||||
|
$watchedDirsPath = array();
|
||||||
|
foreach($watchedDirs as $wd){
|
||||||
|
$watchedDirsPath[] = $wd->getDirectory();
|
||||||
|
}
|
||||||
|
$this->view->watched_dirs = $watchedDirsPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function reloadMetadataAction() {
|
public function reloadMetadataAction() {
|
||||||
|
|
|
@ -43,6 +43,7 @@ try:
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
|
|
||||||
storage_directory = apc.encode_to(response["stor"], 'utf-8')
|
storage_directory = apc.encode_to(response["stor"], 'utf-8')
|
||||||
|
watched_dirs = apc.encode_to(response["watched_dirs"], 'utf-8')
|
||||||
logger.info("Storage Directory is: %s", storage_directory)
|
logger.info("Storage Directory is: %s", storage_directory)
|
||||||
config.storage_directory = os.path.normpath(storage_directory)
|
config.storage_directory = os.path.normpath(storage_directory)
|
||||||
config.imported_directory = os.path.normpath(storage_directory + '/imported')
|
config.imported_directory = os.path.normpath(storage_directory + '/imported')
|
||||||
|
@ -78,6 +79,11 @@ try:
|
||||||
logger.info("Added watch to %s", storage_directory)
|
logger.info("Added watch to %s", storage_directory)
|
||||||
logger.info("wdd result %s", wdd[storage_directory])
|
logger.info("wdd result %s", wdd[storage_directory])
|
||||||
|
|
||||||
|
for dir in watched_dirs:
|
||||||
|
wdd = notifier.watch_directory(dir)
|
||||||
|
logger.info("Added watch to %s", dir)
|
||||||
|
logger.info("wdd result %s", wdd[dir])
|
||||||
|
|
||||||
notifier.loop(callback=pe.notifier_loop_callback)
|
notifier.loop(callback=pe.notifier_loop_callback)
|
||||||
|
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
|
|
Loading…
Reference in New Issue