浏览代码

add dateLastModified on search contentType

Marino Faggiana 7 年之前
父节点
当前提交
bc0c1eb5e7
共有 2 个文件被更改,包括 5 次插入5 次删除
  1. 4 4
      iOSClient/Library/OCCommunicationLib/OCWebDavClient/OCWebDAVClient.m
  2. 1 1
      iOSClient/Photos/CCPhotos.m

+ 4 - 4
iOSClient/Library/OCCommunicationLib/OCWebDavClient/OCWebDAVClient.m

@@ -277,7 +277,7 @@ NSString const *OCWebDAVModificationDateKey	= @"modificationdate";
     
     NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:path parameters:nil timeout:k_timeout_search];
     
-    if (contentType) {
+    if (contentType && dateLastModified) {
         
         body = [NSString stringWithFormat: @""
         "<?xml version=\"1.0\"?>"
@@ -304,14 +304,14 @@ NSString const *OCWebDAVModificationDateKey	= @"modificationdate";
                         "<d:depth>infinity</d:depth>"
                     "</d:scope>"
                 "</d:from>"
-                "<d:where><d:or>", userID];
+                "<d:where><d:and><d:or>", userID];
         
         for (NSString *type in contentType) {
             whereType = [NSString stringWithFormat: @"%@<d:like><d:prop><d:getcontenttype/></d:prop><d:literal>%@</d:literal></d:like>", whereType, type];
         }
         
-        body = [NSString stringWithFormat: @"%@%@</d:or></d:where></d:basicsearch></d:searchrequest>", body, whereType];
-      
+        body = [NSString stringWithFormat: @"%@%@</d:or><d:gte><d:prop><d:getlastmodified/></d:prop><d:literal>%@</d:literal></d:gte></d:and></d:where></d:basicsearch></d:searchrequest>", body, whereType, dateLastModified];
+        
     } else {
         
         body = [NSString stringWithFormat: @""

+ 1 - 1
iOSClient/Photos/CCPhotos.m

@@ -579,7 +579,7 @@
     if (appDelegate.activeAccount.length == 0 || _isSearchMode)
         return;
     
-    [[CCActions sharedInstance] search:@"" fileName:@"" depth:@"infinity" date:[NSDate date] contenType:@[@"image/%", @"video/%"] selector:selectorSearchContentType delegate:self];
+    [[CCActions sharedInstance] search:@"" fileName:@"" depth:@"infinity" date:[NSDate distantPast] contenType:@[@"image/%", @"video/%"] selector:selectorSearchContentType delegate:self];
     
     _isSearchMode = YES;
 }