]> source.dussan.org Git - nextcloud-server.git/commitdiff
when checking if the content of a folder has been updated, exlicitly state that we...
authorRobin Appelman <icewind@owncloud.com>
Sat, 16 Jun 2012 23:26:30 +0000 (01:26 +0200)
committerRobin Appelman <icewind@owncloud.com>
Sat, 16 Jun 2012 23:31:57 +0000 (01:31 +0200)
solves some issues with external storages not updating correctly

lib/filecache.php
lib/filecache/update.php

index 32c6929ff60aea757e2a43ae6a5a6934a7b36049..9963a5a3baf66be27ab4f5b4917b0995be8356eb 100644 (file)
@@ -217,7 +217,7 @@ class OC_FileCache{
         * - versioned
         */
        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);
                }
                return OC_FileCache_Cached::getFolderContent($path,$root,$mimetype_filter);
index 9e23c6dfe7bc3746eb4bb590740c5adef16d289c..2e3eb67da0843930657c83819c6d325983b5ffa0 100644 (file)
@@ -15,9 +15,10 @@ class OC_FileCache_Update{
         * check if a file or folder is updated outside owncloud
         * @param string path
         * @param string root (optional)
+        * @param boolean folder
         * @return bool
         */
-       public static function hasUpdated($path,$root=false){
+       public static function hasUpdated($path,$root=false,$folder=false){
                if($root===false){
                        $view=OC_Filesystem::getView();
                }else{
@@ -29,7 +30,11 @@ class OC_FileCache_Update{
                $cachedData=OC_FileCache_Cached::get($path,$root);
                if(isset($cachedData['mtime'])){
                        $cachedMTime=$cachedData['mtime'];
-                       return $view->hasUpdated($path,$cachedMTime);
+                       if($folder){
+                               return $view->hasUpdated($path.'/',$cachedMTime);
+                       }else{
+                               return $view->hasUpdated($path,$cachedMTime);
+                       }
                }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
                                return false;