Skip to content
Snippets Groups Projects
Commit b38e4627 authored by Robin Appelman's avatar Robin Appelman
Browse files

when checking if the content of a folder has been updated, exlicitly state...

when checking if the content of a folder has been updated, exlicitly state that we are checking a folder

solves some issues with external storages not updating correctly
parent 6f93176a
Branches
No related tags found
No related merge requests found
...@@ -217,7 +217,7 @@ class OC_FileCache{ ...@@ -217,7 +217,7 @@ class OC_FileCache{
* - versioned * - versioned
*/ */
public static function getFolderContent($path,$root=false,$mimetype_filter=''){ public static function getFolderContent($path,$root=false,$mimetype_filter=''){
if(OC_FileCache_Update::hasUpdated($path,$root)){ if(OC_FileCache_Update::hasUpdated($path,$root,true)){
OC_FileCache_Update::updateFolder($path,$root); OC_FileCache_Update::updateFolder($path,$root);
} }
return OC_FileCache_Cached::getFolderContent($path,$root,$mimetype_filter); return OC_FileCache_Cached::getFolderContent($path,$root,$mimetype_filter);
......
...@@ -15,9 +15,10 @@ class OC_FileCache_Update{ ...@@ -15,9 +15,10 @@ class OC_FileCache_Update{
* check if a file or folder is updated outside owncloud * check if a file or folder is updated outside owncloud
* @param string path * @param string path
* @param string root (optional) * @param string root (optional)
* @param boolean folder
* @return bool * @return bool
*/ */
public static function hasUpdated($path,$root=false){ public static function hasUpdated($path,$root=false,$folder=false){
if($root===false){ if($root===false){
$view=OC_Filesystem::getView(); $view=OC_Filesystem::getView();
}else{ }else{
...@@ -29,7 +30,11 @@ class OC_FileCache_Update{ ...@@ -29,7 +30,11 @@ class OC_FileCache_Update{
$cachedData=OC_FileCache_Cached::get($path,$root); $cachedData=OC_FileCache_Cached::get($path,$root);
if(isset($cachedData['mtime'])){ if(isset($cachedData['mtime'])){
$cachedMTime=$cachedData['mtime']; $cachedMTime=$cachedData['mtime'];
if($folder){
return $view->hasUpdated($path.'/',$cachedMTime);
}else{
return $view->hasUpdated($path,$cachedMTime); return $view->hasUpdated($path,$cachedMTime);
}
}else{//file not in cache, so it has to be updated }else{//file not in cache, so it has to be updated
if(($path=='/' or $path=='') and $root===false){//dont auto update the home folder, it will be scanned if(($path=='/' or $path=='') and $root===false){//dont auto update the home folder, it will be scanned
return false; return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment