CC-3561: Add button to automatically rescan watched folders.
-done
This commit is contained in:
parent
dbd6b7444b
commit
295a8ea5fe
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -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') ?>
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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?")){
|
||||
|
|
Loading…
Reference in New Issue