CC-3561: Add button to automatically rescan watched folders.
-done
This commit is contained in:
parent
dbd6b7444b
commit
295a8ea5fe
|
@ -351,6 +351,15 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
$this->view->subform = $watched_dirs_form->render();
|
$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()
|
public function removeWatchDirectoryAction()
|
||||||
{
|
{
|
||||||
$chosen = $this->getRequest()->getParam("dir");
|
$chosen = $this->getRequest()->getParam("dir");
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
<dt id="watchedFolder-label" class="block-display">
|
<dt id="watchedFolder-label" class="block-display">
|
||||||
<label class="required" for="watchedFolder"><?php echo $this->element->getElement('watchedFolder')->getLabel() ?></label>
|
<label class="required" for="watchedFolder"><?php echo $this->element->getElement('watchedFolder')->getLabel() ?></label>
|
||||||
|
<a href="#" id="watchedFolder-rescan">Rescan</a>
|
||||||
</dt>
|
</dt>
|
||||||
<dd id="watchedFolder-element" class="block-display">
|
<dd id="watchedFolder-element" class="block-display">
|
||||||
<?php echo $this->element->getElement('watchedFolder') ?>
|
<?php echo $this->element->getElement('watchedFolder') ?>
|
||||||
|
|
|
@ -1990,6 +1990,17 @@ label span {
|
||||||
line-height:12px;
|
line-height:12px;
|
||||||
padding:0 10px 1px 10px;
|
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 {
|
#watched-folder-section dd.block-display input[type="button"]:hover {
|
||||||
border: 1px solid #242424;
|
border: 1px solid #242424;
|
||||||
background-color: #292929;
|
background-color: #292929;
|
||||||
|
|
|
@ -78,6 +78,10 @@ function setWatchedDirEvents() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#watchedFolder-rescan').click(function(){
|
||||||
|
$.get("/Preference/rescan-watch-directory", {format: "json"});
|
||||||
|
});
|
||||||
|
|
||||||
$('.selected-item').find('.ui-icon-close').click(function(){
|
$('.selected-item').find('.ui-icon-close').click(function(){
|
||||||
if(confirm("Are you sure you want to remove the watched folder?")){
|
if(confirm("Are you sure you want to remove the watched folder?")){
|
||||||
var row = $(this).parent();
|
var row = $(this).parent();
|
||||||
|
|
Loading…
Reference in New Issue