]> source.dussan.org Git - nextcloud-server.git/commitdiff
allow manually scanning of specific directories
authorRobin Appelman <icewind@owncloud.com>
Tue, 24 Apr 2012 21:56:51 +0000 (23:56 +0200)
committerRobin Appelman <icewind@owncloud.com>
Tue, 24 Apr 2012 22:12:12 +0000 (00:12 +0200)
files/ajax/scan.php
files/js/files.js

index db09b7d5c642a6a829d6c5752aa864ef86735270..c60e34b51767429c81f0e4627901bef544e78538 100644 (file)
@@ -5,6 +5,7 @@ require_once '../../lib/base.php';
 set_time_limit(0);//scanning can take ages
 
 $force=isset($_GET['force']) and $_GET['force']=='true';
+$dir=isset($_GET['dir'])?$_GET['dir']:'';
 $checkOnly=isset($_GET['checkonly']) and $_GET['checkonly']=='true';
 
 if(!$checkOnly){
@@ -16,7 +17,7 @@ if(!$checkOnly){
 if($force or !OC_FileCache::inCache('')){
        if(!$checkOnly){
                OC_DB::beginTransaction();
-               OC_FileCache::scan('',$eventSource);
+               OC_FileCache::scan($dir,$eventSource);
                OC_FileCache::clean();
                OC_DB::commit();
                $eventSource->send('success',true);
index 3ce95f992d0b3835cd52a7dd2bb713f7ecd7811c..73a16100a69cc43a66997e8f406f055d8f3a1612 100644 (file)
@@ -370,12 +370,12 @@ $(document).ready(function() {
        }, "json");
 });
 
-function scanFiles(force){
+function scanFiles(force,dir){
        force=!!force; //cast to bool
        scanFiles.scanning=true;
        $('#scanning-message').show();
        $('#fileList').remove();
-       var scannerEventSource=new OC.EventSource(OC.filePath('files','ajax','scan.php'),{force:force});
+       var scannerEventSource=new OC.EventSource(OC.filePath('files','ajax','scan.php'),{force:force,dir:dir});
        scanFiles.cancel=scannerEventSource.close.bind(scannerEventSource);
        scannerEventSource.listen('scanning',function(data){
                $('#scan-count').text(data.count+' files scanned');