CC-3561: Add button to automatically rescan watched folders.
-done
This commit is contained in:
parent
70bfe031ef
commit
d02607ed94
6 changed files with 32 additions and 11 deletions
|
@ -353,10 +353,12 @@ class PreferenceController extends Zend_Controller_Action
|
|||
|
||||
public function rescanWatchDirectoryAction()
|
||||
{
|
||||
$dirs = Application_Model_MusicDir::getWatchedDirs();
|
||||
foreach ($dirs as $dir) {
|
||||
$res = Application_Model_MusicDir::addWatchedDir($dir->getDirectory());
|
||||
}
|
||||
$dir = Application_Model_MusicDir::getDirByPath($this->getRequest()->getParam("dir"));
|
||||
$id = $dir->getId();
|
||||
$data = array();
|
||||
$data['directory'] = $dir->getDirectory();
|
||||
$data['id'] = $id;
|
||||
Application_Model_RabbitMq::SendMessageToMediaMonitor('rescan_watch', $data);
|
||||
die();
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
<dt id="watchedFolder-label" class="block-display">
|
||||
<label class="required" for="watchedFolder"><?php echo $this->element->getElement('watchedFolder')->getLabel() ?></label>
|
||||
<a href="#" id="watchedFolder-rescan">Rescan</a>
|
||||
|
||||
</dt>
|
||||
<dd id="watchedFolder-element" class="block-display">
|
||||
<?php echo $this->element->getElement('watchedFolder') ?>
|
||||
|
@ -39,7 +39,10 @@
|
|||
<?php if (count($watched_dirs) > 0): ?>
|
||||
<?php foreach($watched_dirs as $watched_dir): ?>
|
||||
<dd class="block-display selected-item">
|
||||
<?php echo ($watched_dir->getExistsFlag())?"":"<span class='ui-icon-alert'><img src='/css/images/warning-icon.png'></span>"?><span><?php echo $watched_dir->getDirectory();?></span></span><span class="ui-icon ui-icon-close"></span>
|
||||
<?php echo ($watched_dir->getExistsFlag())?"":"<span class='ui-icon-alert'><img src='/css/images/warning-icon.png'></span>"?><span id="folderPath"><?php echo $watched_dir->getDirectory();?></span></span>
|
||||
<span title="Rescan watched directory (This is useful if it is network mount and may be out of sync with Airtime)" class="ui-icon ui-icon-refresh"></span>
|
||||
<span title="Remove watched directory" class="ui-icon ui-icon-close"></span>
|
||||
|
||||
</dd>
|
||||
<?php endforeach; ?>
|
||||
<?php else: ?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue