Browse Source

Add the possibility of webDAV search with contentType

Marino Faggiana 7 years ago
parent
commit
ede4805412

+ 2 - 2
iOSClient/Main/CCDetail.m

@@ -654,9 +654,9 @@
     NSString *serverUrl = [[NCManageDatabase sharedInstance] getServerUrl:metadata.directoryID];
     NSString *serverUrl = [[NCManageDatabase sharedInstance] getServerUrl:metadata.directoryID];
     
     
     if (serverUrl) {
     if (serverUrl) {
-        [[CCNetworking sharedNetworking] downloadFile:metadata.fileName fileID:metadata.fileID serverUrl:serverUrl selector:selectorLoadViewImage selectorPost:nil session:k_download_session taskStatus:k_taskStatusResume delegate:appDelegate.activeMain];
-    
         [_hud visibleHudTitle:@"" mode:MBProgressHUDModeDeterminate color:[NCBrandColor sharedInstance].brandElement];
         [_hud visibleHudTitle:@"" mode:MBProgressHUDModeDeterminate color:[NCBrandColor sharedInstance].brandElement];
+
+        [[CCNetworking sharedNetworking] downloadFile:metadata.fileName fileID:metadata.fileID serverUrl:serverUrl selector:selectorLoadViewImage selectorPost:nil session:k_download_session taskStatus:k_taskStatusResume delegate:appDelegate.activeMain];    
     }
     }
 }
 }
 
 

+ 2 - 0
iOSClient/Main/CCSection.h

@@ -38,6 +38,8 @@
 @property NSInteger files;
 @property NSInteger files;
 @property double totalSize;
 @property double totalSize;
 
 
+- (id)copyWithZone:(NSZone *)zone;
+
 @end
 @end
 
 
 @interface CCSectionMetadata : NSObject
 @interface CCSectionMetadata : NSObject

+ 20 - 0
iOSClient/Main/CCSection.m

@@ -46,6 +46,26 @@
     return self;
     return self;
 }
 }
 
 
+- (id)copyWithZone: (NSZone *) zone
+{
+    CCSectionDataSourceMetadata *sectionDataSourceMetadata = [[CCSectionDataSourceMetadata allocWithZone: zone] init];
+    
+    [sectionDataSourceMetadata setAllRecordsDataSource: self.allRecordsDataSource];
+    [sectionDataSourceMetadata setAllEtag: self.allEtag];
+    [sectionDataSourceMetadata setSections: self.sections];
+    [sectionDataSourceMetadata setSectionArrayRow: self.sectionArrayRow];
+    [sectionDataSourceMetadata setFileIDIndexPath: self.fileIDIndexPath];
+    
+    [sectionDataSourceMetadata setVideo: self.video];
+    [sectionDataSourceMetadata setImage: self.image];
+    
+    [sectionDataSourceMetadata setDirectories: self.directories];
+    [sectionDataSourceMetadata setFiles: self.files];
+    [sectionDataSourceMetadata setTotalSize: self.totalSize];
+    
+    return sectionDataSourceMetadata;
+}
+
 @end
 @end
 
 
 
 

+ 2 - 1
iOSClient/Photos/CCPhotos.m

@@ -544,9 +544,10 @@
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
 
 
         NSArray *results = [[NCManageDatabase sharedInstance] getTableMetadatasContentTypeImageVideo];
         NSArray *results = [[NCManageDatabase sharedInstance] getTableMetadatasContentTypeImageVideo];
-        _sectionDataSource = [CCSectionMetadata creataDataSourseSectionMetadata:results listProgressMetadata:nil e2eEncryptions:nil groupByField:@"date" activeAccount:appDelegate.activeAccount];
+        CCSectionDataSourceMetadata *tempSectionDataSource = [CCSectionMetadata creataDataSourseSectionMetadata:results listProgressMetadata:nil e2eEncryptions:nil groupByField:@"date" activeAccount:appDelegate.activeAccount];
         
         
         dispatch_async(dispatch_get_main_queue(), ^{
         dispatch_async(dispatch_get_main_queue(), ^{
+            _sectionDataSource = [tempSectionDataSource copy];
             [self reloadCollection];
             [self reloadCollection];
         });
         });
     });
     });