Browse Source

clear code

Marino Faggiana 7 years ago
parent
commit
375a94e13a

+ 1 - 1
iOSClient/AppDelegate.m

@@ -341,7 +341,7 @@
     NSLog(@"[LOG] Update Folder Photo");
     NSString *autoUploadPath = [[NCManageDatabase sharedInstance] getAccountAutoUploadPath:_activeUrl];
     if ([autoUploadPath length] > 0)
-        [[CCSynchronize sharedSynchronize] readFolderServerUrl:autoUploadPath directoryID:[[NCManageDatabase sharedInstance] getDirectoryID:autoUploadPath] selector:selectorReadFolder];
+        [[CCSynchronize sharedSynchronize] readFolderServerUrl:autoUploadPath selector:selectorReadFolder];
 
     // Execute : after 0.5 sec.
     

+ 2 - 1
iOSClient/Favorites/CCSynchronize.h

@@ -38,6 +38,7 @@
 - (void)addFavoriteFolder:(NSString *)serverUrl;
 
 - (void)verifyChangeMedatas:(NSArray *)allRecordMetadatas serverUrl:(NSString *)serverUrl account:(NSString *)account withDownload:(BOOL)withDownload;
-- (void)readFolderServerUrl:(NSString *)serverUrl directoryID:(NSString *)directoryID selector:(NSString *)selector;
+
+- (void)readFolderServerUrl:(NSString *)serverUrl selector:(NSString *)selector;
 
 @end

+ 9 - 6
iOSClient/Favorites/CCSynchronize.m

@@ -119,7 +119,6 @@
             
             if (metadata.directory) {
                 
-                NSString *directoryID = [[NCManageDatabase sharedInstance] getDirectoryID:serverUrl];
                 NSString *selector;
                 
                 if ([CCUtility getFavoriteOffline])
@@ -127,7 +126,7 @@
                 else
                     selector = selectorReadFolder;
                 
-                [self readFolderServerUrl:serverUrl directoryID:directoryID selector:selector];
+                [self readFolderServerUrl:serverUrl selector:selector];
                 
             } else {
                 
@@ -160,12 +159,17 @@
 #pragma mark ===== Read Folder =====
 #pragma --------------------------------------------------------------------------------------------
 
-- (void)readFolderServerUrl:(NSString *)serverUrl directoryID:(NSString *)directoryID selector:(NSString *)selector
+// serverUrl    : start
+// directoryID  : start
+// selector     : selectorReadFolder, selectorReadFolderWithDownload
+//
+
+- (void)readFolderServerUrl:(NSString *)serverUrl selector:(NSString *)selector
 {
     CCMetadataNet *metadataNet = [[CCMetadataNet alloc] initWithAccount:app.activeAccount];
     
     metadataNet.action = actionReadFolder;
-    metadataNet.directoryID = directoryID;
+    metadataNet.directoryID = [[NCManageDatabase sharedInstance] getDirectoryID:serverUrl];
     metadataNet.priority = NSOperationQueuePriorityNormal;
     metadataNet.selector = selector;
     metadataNet.serverUrl = serverUrl;
@@ -262,7 +266,6 @@
             if (metadata.directory) {
                 
                 NSString *serverUrl = [CCUtility stringAppendServerUrl:metadataNet.serverUrl addFileName:metadata.fileNameData];
-                NSString *directoryID = [[NCManageDatabase sharedInstance] getDirectoryID:serverUrl];
                 NSString *etag = metadata.etag;
                 
                 // Verify if do not exists this Metadata
@@ -278,7 +281,7 @@
                     
                     [[NCManageDatabase sharedInstance] setDirectoryWithServerUrl:serverUrl serverUrlTo:nil etag:etag];
                     
-                    [self readFolderServerUrl:serverUrl directoryID:directoryID selector:metadataNet.selector];
+                    [self readFolderServerUrl:serverUrl selector:metadataNet.selector];
                 }
                 
             } else {

+ 1 - 2
iOSClient/Main/CCMain.m

@@ -4292,8 +4292,7 @@
                                         NSLog(@"[LOG] Update Folder Photo");
                                         NSString *autoUploadPath = [[NCManageDatabase sharedInstance] getAccountAutoUploadPath:app.activeUrl];
                                         if ([autoUploadPath length] > 0)
-                                            [[CCSynchronize sharedSynchronize] readFolderServerUrl:autoUploadPath directoryID:[[NCManageDatabase sharedInstance] getDirectoryID:autoUploadPath] selector:selectorReadFolder];
-                                        
+                                            [[CCSynchronize sharedSynchronize] readFolderServerUrl:autoUploadPath selector:selectorReadFolder];
                                     }];
         }