diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-04-24 23:56:51 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-04-25 00:12:12 +0200 |
commit | fa502e160df470ffa2ab02d6a8e9e8a0d4f6f0f4 (patch) | |
tree | 9ef38fc61f15093744a48a5c3985c3db9bd92c37 /files | |
parent | 9b134b063683aca678e19912ebc3928321751714 (diff) | |
download | nextcloud-server-fa502e160df470ffa2ab02d6a8e9e8a0d4f6f0f4.tar.gz nextcloud-server-fa502e160df470ffa2ab02d6a8e9e8a0d4f6f0f4.zip |
allow manually scanning of specific directories
Diffstat (limited to 'files')
-rw-r--r-- | files/ajax/scan.php | 3 | ||||
-rw-r--r-- | files/js/files.js | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/files/ajax/scan.php b/files/ajax/scan.php index db09b7d5c64..c60e34b5176 100644 --- a/files/ajax/scan.php +++ b/files/ajax/scan.php @@ -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); diff --git a/files/js/files.js b/files/js/files.js index 3ce95f992d0..73a16100a69 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -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'); |