Marino Faggiana 8 жил өмнө
parent
commit
6b31f8cb22

+ 5 - 3
iOSClient/FileSystem/NCManageDatabase.swift

@@ -1262,10 +1262,12 @@ class NCManageDatabase: NSObject {
                 if sessionTaskIdentifierPlist != Int(k_taskIdentifierNULL) {
                 if sessionTaskIdentifierPlist != Int(k_taskIdentifierNULL) {
                     result.sessionTaskIdentifierPlist = sessionTaskIdentifierPlist
                     result.sessionTaskIdentifierPlist = sessionTaskIdentifierPlist
                 }
                 }
-                
-                self.setDateReadDirectory(directoryID: result.directoryID)
             }
             }
         }
         }
+        
+        if results.count > 0 {
+            self.setDateReadDirectory(directoryID: results[0].directoryID)
+        }
     }
     }
     
     
     func setMetadataFavorite(fileID: String, favorite: Bool) {
     func setMetadataFavorite(fileID: String, favorite: Bool) {
@@ -1429,7 +1431,7 @@ class NCManageDatabase: NSObject {
         return self.getMetadatas(predicate: predicate, sorted: nil, ascending: false)
         return self.getMetadatas(predicate: predicate, sorted: nil, ascending: false)
     }
     }
 
 
-    func getRecordsTableMetadataPhotosCameraUpload(serverUrl: String) -> [tableMetadata]? {
+    func getTableMetadatasPhotosCameraUpload(serverUrl: String) -> [tableMetadata]? {
         
         
         let tableAccount = self.getAccountActive()
         let tableAccount = self.getAccountActive()
         if tableAccount == nil {
         if tableAccount == nil {

+ 2 - 2
iOSClient/PhotosCameraUpload/CCPhotosCameraUpload.m

@@ -531,7 +531,7 @@
         
         
         dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
         dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
             
             
-            NSArray *results = [[NCManageDatabase sharedInstance] getRecordsTableMetadataPhotosCameraUploadWithServerUrl:serverUrl];
+            NSArray *results = [[NCManageDatabase sharedInstance] getTableMetadatasPhotosCameraUploadWithServerUrl:serverUrl];
             
             
             _sectionDataSource = [CCSectionMetadata creataDataSourseSectionMetadata:results listProgressMetadata:nil groupByField:@"date" replaceDateToExifDate:YES activeAccount:app.activeAccount];
             _sectionDataSource = [CCSectionMetadata creataDataSourseSectionMetadata:results listProgressMetadata:nil groupByField:@"date" replaceDateToExifDate:YES activeAccount:app.activeAccount];
             
             
@@ -542,7 +542,7 @@
 
 
     } else {
     } else {
         
         
-        NSArray *results = [[NCManageDatabase sharedInstance] getRecordsTableMetadataPhotosCameraUploadWithServerUrl:serverUrl];
+        NSArray *results = [[NCManageDatabase sharedInstance] getTableMetadatasPhotosCameraUploadWithServerUrl:serverUrl];
         
         
         _sectionDataSource = [CCSectionMetadata creataDataSourseSectionMetadata:results listProgressMetadata:nil groupByField:@"date" replaceDateToExifDate:YES activeAccount:app.activeAccount];
         _sectionDataSource = [CCSectionMetadata creataDataSourseSectionMetadata:results listProgressMetadata:nil groupByField:@"date" replaceDateToExifDate:YES activeAccount:app.activeAccount];
         [self reloadCollection];
         [self reloadCollection];