CC-3561: Add button to automatically rescan watched folders.

-done
This commit is contained in:
denise 2012-06-14 13:44:56 -04:00
parent dbd6b7444b
commit 295a8ea5fe
4 changed files with 25 additions and 0 deletions

View File

@ -350,6 +350,15 @@ class PreferenceController extends Zend_Controller_Action
$this->view->subform = $watched_dirs_form->render();
}
public function rescanWatchDirectoryAction()
{
$dirs = Application_Model_MusicDir::getWatchedDirs();
foreach ($dirs as $dir) {
$res = Application_Model_MusicDir::addWatchedDir($dir->getDirectory());
}
die();
}
public function removeWatchDirectoryAction()
{

View File

@ -20,6 +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') ?>

View File

@ -1990,6 +1990,17 @@ label span {
line-height:12px;
padding:0 10px 1px 10px;
}
#watched-folder-section a {
font-size: 12px;
}
#watched-folder-section a:hover {
text-decoration:none;
color:#FF5D1A;
cursor:pointer;
}
#watched-folder-section dd.block-display input[type="button"]:hover {
border: 1px solid #242424;
background-color: #292929;

View File

@ -77,6 +77,10 @@ function setWatchedDirEvents() {
setWatchedDirEvents();
});
});
$('#watchedFolder-rescan').click(function(){
$.get("/Preference/rescan-watch-directory", {format: "json"});
});
$('.selected-item').find('.ui-icon-close').click(function(){
if(confirm("Are you sure you want to remove the watched folder?")){