Browse Source

clear code

Marino Faggiana 7 years ago
parent
commit
a688edd4f1

+ 1 - 1
iOSClient/AppDelegate.h

@@ -159,7 +159,7 @@
 
 - (NSMutableArray *)verifyExistsInQueuesDownloadSelector:(NSString *)selector;
 
-- (void)loadAutomaticUpload:(NSNumber *)maxConcurrent;
+- (void)loadAutoUpload:(NSNumber *)maxConcurrent;
 
 - (BOOL)createFolderSubFolderAutomaticUploadFolderPhotos:(NSString *)folderPhotos useSubFolder:(BOOL)useSubFolder assets:(NSArray *)assets selector:(NSString *)selector;
 

+ 17 - 17
iOSClient/AppDelegate.m

@@ -376,12 +376,12 @@
     if ([[UIApplication sharedApplication] applicationState] == UIApplicationStateBackground) {
 
         // ONLY BACKGROUND
-        [app performSelectorOnMainThread:@selector(loadAutomaticUpload:) withObject:[NSNumber numberWithInt:1] waitUntilDone:NO];
+        [app performSelectorOnMainThread:@selector(loadAutoUpload:) withObject:[NSNumber numberWithInt:k_maxConcurrentOperationDownloadUploadBackground] waitUntilDone:NO];
         
     } else {
 
         // ONLY FOREFROUND
-        [app performSelectorOnMainThread:@selector(loadAutomaticUpload:) withObject:[NSNumber numberWithInt:k_maxConcurrentOperationDownloadUpload] waitUntilDone:NO];    
+        [app performSelectorOnMainThread:@selector(loadAutoUpload:) withObject:[NSNumber numberWithInt:k_maxConcurrentOperationDownloadUpload] waitUntilDone:NO];
     }
 }
 
@@ -937,7 +937,7 @@
     NSInteger queueUpload = [self getNumberUploadInQueues] + [self getNumberUploadInQueuesWWan];
     
     // Total
-    NSInteger total = queueDownload + queueUpload + [[NCManageDatabase sharedInstance] countAutomaticUploadWithSession:nil];
+    NSInteger total = queueDownload + queueUpload + [[NCManageDatabase sharedInstance] countAutoUploadWithSession:nil];
     
     [UIApplication sharedApplication].applicationIconBadgeNumber = total;
     
@@ -1355,7 +1355,7 @@
     return queueNumUploadWWan;
 }
 
-- (void)loadAutomaticUpload:(NSNumber *)maxConcurrent
+- (void)loadAutoUpload:(NSNumber *)maxConcurrent
 {
     CCMetadataNet *metadataNet;
     NSInteger counterUpload = 0;
@@ -1363,37 +1363,37 @@
     
     NSArray *uploadInQueue = [[NCManageDatabase sharedInstance] getTableMetadataUpload];
     
-    NSArray *recordAutomaticUploadInLock =  [[NCManageDatabase sharedInstance] getLockAutomaticUpload];
+    NSArray *recordAutomaticUploadInLock =  [[NCManageDatabase sharedInstance] getLockAutoUpload];
     
-    for (tableAutomaticUpload *tableAutomaticUpload in recordAutomaticUploadInLock) {
+    for (tableAutoUpload *tableAutoUpload in recordAutomaticUploadInLock) {
         
         BOOL recordFound = NO;
         
         for (CCMetadataNet *metadataNet in uploadInQueue) {
-            if (metadataNet.assetLocalIdentifier == tableAutomaticUpload.assetLocalIdentifier)
+            if (metadataNet.assetLocalIdentifier == tableAutoUpload.assetLocalIdentifier)
                 recordFound = YES;
         }
         
         if (!recordFound)
-            [[NCManageDatabase sharedInstance] unlockAutomaticUploadWithAssetLocalIdentifier:tableAutomaticUpload.assetLocalIdentifier];
+            [[NCManageDatabase sharedInstance] unlockAutoUploadWithAssetLocalIdentifier:tableAutoUpload.assetLocalIdentifier];
     }
 
-    // ------------------------- <selectorUploadAutomatic> -------------------------
+    // ------------------------- <selector Auto Upload> -------------------------
     
-    metadataNet = [[NCManageDatabase sharedInstance] getAutomaticUploadWithSelector:selectorUploadAutomatic];
+    metadataNet = [[NCManageDatabase sharedInstance] getAutoUploadWithSelector:selectorUploadAutoUpload];
     counterUpload = [self getNumberUploadInQueues] + [self getNumberUploadInQueuesWWan];
     while (metadataNet && counterUpload < maxConcurrentOperationDownloadUpload) {
         
         [[CCNetworking sharedNetworking] uploadFileFromAssetLocalIdentifier:metadataNet.assetLocalIdentifier fileName:metadataNet.fileName serverUrl:metadataNet.serverUrl cryptated:metadataNet.cryptated session:metadataNet.session taskStatus:metadataNet.taskStatus selector:metadataNet.selector selectorPost:metadataNet.selectorPost errorCode:metadataNet.errorCode delegate:app.activeMain];
         
-        metadataNet =  [[NCManageDatabase sharedInstance] getAutomaticUploadWithSelector:selectorUploadAutomatic];
+        metadataNet =  [[NCManageDatabase sharedInstance] getAutoUploadWithSelector:selectorUploadAutoUpload];
         counterUpload++;
     }
     
-    // ------------------------- <selectorUploadAutomaticAll> ----------------------
+    // ------------------------- <selector Auto Upload All> ----------------------
     
     // Verify num error MAX 10 after STOP
-    NSArray *metadatas = [[NCManageDatabase sharedInstance] getMetadatasWithPredicate:[NSPredicate predicateWithFormat:@"account = %@ AND sessionSelector = %@ AND (sessionTaskIdentifier = %i OR sessionTaskIdentifierPlist = %i)", app.activeAccount, selectorUploadAutomaticAll, k_taskIdentifierError, k_taskIdentifierError] sorted:nil ascending:NO];
+    NSArray *metadatas = [[NCManageDatabase sharedInstance] getMetadatasWithPredicate:[NSPredicate predicateWithFormat:@"account = %@ AND sessionSelector = %@ AND (sessionTaskIdentifier = %i OR sessionTaskIdentifierPlist = %i)", app.activeAccount, selectorUploadAutoUploadAll, k_taskIdentifierError, k_taskIdentifierError] sorted:nil ascending:NO];
     
     NSInteger errorCount = [metadatas count];
     
@@ -1403,7 +1403,7 @@
         return;
     }
     
-    metadataNet =  [[NCManageDatabase sharedInstance] getAutomaticUploadWithSelector:selectorUploadAutomaticAll];
+    metadataNet =  [[NCManageDatabase sharedInstance] getAutoUploadWithSelector:selectorUploadAutoUploadAll];
     counterUpload = [self getNumberUploadInQueues] + [self getNumberUploadInQueuesWWan];
     while (metadataNet && counterUpload < maxConcurrentOperationDownloadUpload) {
         
@@ -1417,12 +1417,12 @@
             
         } else {
             
-            [[NCManageDatabase sharedInstance] addActivityClient:metadataNet.fileName fileID:metadataNet.assetLocalIdentifier action:k_activityDebugActionUpload selector:selectorUploadAutomatic note:@"Internal error image/video not found [0]" type:k_activityTypeFailure verbose:k_activityVerboseHigh activeUrl:_activeUrl];
+            [[NCManageDatabase sharedInstance] addActivityClient:metadataNet.fileName fileID:metadataNet.assetLocalIdentifier action:k_activityDebugActionUpload selector:selectorUploadAutoUploadAll note:@"Internal error image/video not found [0]" type:k_activityTypeFailure verbose:k_activityVerboseHigh activeUrl:_activeUrl];
             
-            [[NCManageDatabase sharedInstance] deleteAutomaticUploadWithAssetLocalIdentifier:metadataNet.assetLocalIdentifier];
+            [[NCManageDatabase sharedInstance] deleteAutoUploadWithAssetLocalIdentifier:metadataNet.assetLocalIdentifier];
         }
         
-        metadataNet =  [[NCManageDatabase sharedInstance] getAutomaticUploadWithSelector:selectorUploadAutomaticAll];
+        metadataNet =  [[NCManageDatabase sharedInstance] getAutoUploadWithSelector:selectorUploadAutoUploadAll];
     }
 }
 

+ 2 - 2
iOSClient/CCGlobal.h

@@ -185,8 +185,8 @@ extern NSString *const urlBaseUploadDB;
 #define selectorSearch                                  @"search"
 #define selectorUnshare                                 @"unshare"
 #define selectorUpdateShare                             @"updateShare"
-#define selectorUploadAutomatic                         @"uploadAutomatic"
-#define selectorUploadAutomaticAll                      @"uploadAutomaticAll"
+#define selectorUploadAutoUpload                        @"uploadAutoUpload"
+#define selectorUploadAutoUploadAll                     @"uploadAutoUploadAll"
 #define selectorUploadFile                              @"uploadFile"
 #define selectorUploadFileCrypto                        @"uploadFileCrypto"
 #define selectorUploadFilePlist                         @"uploadFilePlist"

+ 1 - 1
iOSClient/Database/NCDatabase.swift

@@ -72,7 +72,7 @@ class tableActivity: Object {
     dynamic var verbose : Bool = false
 }
 
-class tableAutomaticUpload: Object {
+class tableAutoUpload: Object {
     
     dynamic var account = ""
     dynamic var assetLocalIdentifier = ""

+ 25 - 25
iOSClient/Database/NCManageDatabase.swift

@@ -479,7 +479,7 @@ class NCManageDatabase: NSObject {
     //MARK: -
     //MARK: Table Automatic Upload
     
-    func addAutomaticUpload(metadataNet: CCMetadataNet) -> Bool {
+    func addAutoUpload(metadataNet: CCMetadataNet) -> Bool {
         
         let tableAccount = self.getAccountActive()
         if tableAccount == nil {
@@ -488,7 +488,7 @@ class NCManageDatabase: NSObject {
         
         let realm = try! Realm()
             
-        let result = realm.objects(tableAutomaticUpload.self).filter("account = %@ AND assetLocalIdentifier = %@", tableAccount!.account, metadataNet.assetLocalIdentifier).first
+        let result = realm.objects(tableAutoUpload.self).filter("account = %@ AND assetLocalIdentifier = %@", tableAccount!.account, metadataNet.assetLocalIdentifier).first
         
         if result != nil {
             return false
@@ -496,27 +496,27 @@ class NCManageDatabase: NSObject {
         
         try! realm.write {
             
-            // Add new AutomaticUpload
-            let addAutomaticUpload = tableAutomaticUpload()
+            // Add new Auto Upload
+            let addAutoUpload = tableAutoUpload()
             
-            addAutomaticUpload.account = tableAccount!.account
-            addAutomaticUpload.assetLocalIdentifier = metadataNet.assetLocalIdentifier
-            addAutomaticUpload.fileName = metadataNet.fileName
-            addAutomaticUpload.selector = metadataNet.selector
+            addAutoUpload.account = tableAccount!.account
+            addAutoUpload.assetLocalIdentifier = metadataNet.assetLocalIdentifier
+            addAutoUpload.fileName = metadataNet.fileName
+            addAutoUpload.selector = metadataNet.selector
             if (metadataNet.selectorPost != nil) {
-                addAutomaticUpload.selectorPost = metadataNet.selectorPost
+                addAutoUpload.selectorPost = metadataNet.selectorPost
             }
-            addAutomaticUpload.serverUrl = metadataNet.serverUrl
-            addAutomaticUpload.session = metadataNet.session
-            addAutomaticUpload.priority = metadataNet.priority
+            addAutoUpload.serverUrl = metadataNet.serverUrl
+            addAutoUpload.session = metadataNet.session
+            addAutoUpload.priority = metadataNet.priority
             
-            realm.add(addAutomaticUpload)
+            realm.add(addAutoUpload)
         }
 
         return true
     }
     
-    func getAutomaticUpload(selector: String) -> CCMetadataNet? {
+    func getAutoUpload(selector: String) -> CCMetadataNet? {
         
         let tableAccount = self.getAccountActive()
         if tableAccount == nil {
@@ -525,7 +525,7 @@ class NCManageDatabase: NSObject {
         
         let realm = try! Realm()
         
-        let result = realm.objects(tableAutomaticUpload.self).filter("account = %@ AND selector = %@ AND lock == false", tableAccount!.account, selector).first
+        let result = realm.objects(tableAutoUpload.self).filter("account = %@ AND selector = %@ AND lock == false", tableAccount!.account, selector).first
         
         if result == nil {
             return nil
@@ -551,7 +551,7 @@ class NCManageDatabase: NSObject {
         return metadataNet
     }
     
-    func getLockAutomaticUpload() -> [tableAutomaticUpload]? {
+    func getLockAutoUpload() -> [tableAutoUpload]? {
         
         let tableAccount = self.getAccountActive()
         if tableAccount == nil {
@@ -560,12 +560,12 @@ class NCManageDatabase: NSObject {
         
         let realm = try! Realm()
         
-        let results = realm.objects(tableAutomaticUpload.self).filter("account = %@ AND lock = true", tableAccount!.account)
+        let results = realm.objects(tableAutoUpload.self).filter("account = %@ AND lock = true", tableAccount!.account)
         
         return Array(results)
     }
 
-    func unlockAutomaticUpload(assetLocalIdentifier: String) {
+    func unlockAutoUpload(assetLocalIdentifier: String) {
         
         let tableAccount = self.getAccountActive()
         if tableAccount == nil {
@@ -574,7 +574,7 @@ class NCManageDatabase: NSObject {
         
         let realm = try! Realm()
         
-        let result = realm.objects(tableAutomaticUpload.self).filter("account = %@ AND assetLocalIdentifier = %@", tableAccount!.account, assetLocalIdentifier).first
+        let result = realm.objects(tableAutoUpload.self).filter("account = %@ AND assetLocalIdentifier = %@", tableAccount!.account, assetLocalIdentifier).first
         
         if result != nil {
             
@@ -585,7 +585,7 @@ class NCManageDatabase: NSObject {
         }
     }
     
-    func deleteAutomaticUpload(assetLocalIdentifier: String) {
+    func deleteAutoUpload(assetLocalIdentifier: String) {
         
         let tableAccount = self.getAccountActive()
         if tableAccount == nil {
@@ -594,7 +594,7 @@ class NCManageDatabase: NSObject {
 
         let realm = try! Realm()
 
-        let result = realm.objects(tableAutomaticUpload.self).filter("account = %@ AND assetLocalIdentifier = %@", tableAccount!.account, assetLocalIdentifier).first
+        let result = realm.objects(tableAutoUpload.self).filter("account = %@ AND assetLocalIdentifier = %@", tableAccount!.account, assetLocalIdentifier).first
         
         if result != nil {
             
@@ -604,7 +604,7 @@ class NCManageDatabase: NSObject {
         }
     }
     
-    func countAutomaticUpload(session: String?) -> Int {
+    func countAutoUpload(session: String?) -> Int {
         
         let tableAccount = self.getAccountActive()
         if tableAccount == nil {
@@ -612,15 +612,15 @@ class NCManageDatabase: NSObject {
         }
 
         let realm = try! Realm()
-        let results : Results<tableAutomaticUpload>
+        let results : Results<tableAutoUpload>
         
         if (session == nil) {
             
-            results = realm.objects(tableAutomaticUpload.self).filter("account = %@", tableAccount!.account)
+            results = realm.objects(tableAutoUpload.self).filter("account = %@", tableAccount!.account)
             
         } else {
             
-            results = realm.objects(tableAutomaticUpload.self).filter("account = %@ AND session = %@", tableAccount!.account, session!)
+            results = realm.objects(tableAutoUpload.self).filter("account = %@ AND session = %@", tableAccount!.account, session!)
         }
         
         return results.count

+ 19 - 7
iOSClient/Main/CCMain.m

@@ -1616,9 +1616,20 @@
 
 - (void)uploadFileFailure:(CCMetadataNet *)metadataNet fileID:(NSString *)fileID serverUrl:(NSString *)serverUrl selector:(NSString *)selector message:(NSString *)message errorCode:(NSInteger)errorCode
 {
-    // Automatic upload All
-    if([selector isEqualToString:selectorUploadAutomaticAll])
-        [app performSelectorOnMainThread:@selector(loadAutomaticUpload:) withObject:[NSNumber numberWithInt:k_maxConcurrentOperationDownloadUpload] waitUntilDone:NO];
+    // Auto Upload
+    if([selector isEqualToString:selectorUploadAutoUpload] || [selector isEqualToString:selectorUploadAutoUploadAll]) {
+        
+        if ([[UIApplication sharedApplication] applicationState] == UIApplicationStateBackground) {
+            
+            // ONLY BACKGROUND
+            [app performSelectorOnMainThread:@selector(loadAutoUpload:) withObject:[NSNumber numberWithInt:k_maxConcurrentOperationDownloadUploadBackground] waitUntilDone:NO];
+            
+        } else {
+            
+            // ONLY FOREFROUND
+            [app performSelectorOnMainThread:@selector(loadAutoUpload:) withObject:[NSNumber numberWithInt:k_maxConcurrentOperationDownloadUpload] waitUntilDone:NO];
+        }
+    }
     
     // Read File test do not exists
     if (errorCode == k_CCErrorFileUploadNotFound && fileID) {
@@ -1641,17 +1652,18 @@
 
 - (void)uploadFileSuccess:(CCMetadataNet *)metadataNet fileID:(NSString *)fileID serverUrl:(NSString *)serverUrl selector:(NSString *)selector selectorPost:(NSString *)selectorPost
 {
-    if([selector isEqualToString:selectorUploadAutomatic] || [selector isEqualToString:selectorUploadAutomaticAll]) {
+    // Auto Upload
+    if([selector isEqualToString:selectorUploadAutoUpload] || [selector isEqualToString:selectorUploadAutoUploadAll]) {
     
         if ([[UIApplication sharedApplication] applicationState] == UIApplicationStateBackground) {
         
             // ONLY BACKGROUND
-            [app performSelectorOnMainThread:@selector(loadAutomaticUpload:) withObject:[NSNumber numberWithInt:1] waitUntilDone:NO];
+            [app performSelectorOnMainThread:@selector(loadAutoUpload:) withObject:[NSNumber numberWithInt:k_maxConcurrentOperationDownloadUploadBackground] waitUntilDone:NO];
         
         } else {
         
             // ONLY FOREFROUND
-            [app performSelectorOnMainThread:@selector(loadAutomaticUpload:) withObject:[NSNumber numberWithInt:k_maxConcurrentOperationDownloadUpload] waitUntilDone:NO];
+            [app performSelectorOnMainThread:@selector(loadAutoUpload:) withObject:[NSNumber numberWithInt:k_maxConcurrentOperationDownloadUpload] waitUntilDone:NO];
         }
     }
     
@@ -3284,7 +3296,7 @@
     if ([NCBrandOptions sharedInstance].disable_multiaccount)
         return;
     
-    if ([app.netQueue operationCount] > 0 || [app.netQueueDownload operationCount] > 0 || [app.netQueueDownloadWWan operationCount] > 0 || [app.netQueueUpload operationCount] > 0 || [app.netQueueUploadWWan operationCount] > 0 || [[NCManageDatabase sharedInstance] countAutomaticUploadWithSession:nil] > 0) {
+    if ([app.netQueue operationCount] > 0 || [app.netQueueDownload operationCount] > 0 || [app.netQueueDownloadWWan operationCount] > 0 || [app.netQueueUpload operationCount] > 0 || [app.netQueueUploadWWan operationCount] > 0 || [[NCManageDatabase sharedInstance] countAutoUploadWithSession:nil] > 0) {
         
         [app messageNotification:@"_transfers_in_queue_" description:nil visible:YES delay:k_dismissAfterSecond type:TWMessageBarMessageTypeInfo errorCode:0];
         return;

+ 8 - 8
iOSClient/Networking/CCNetworking.m

@@ -771,14 +771,14 @@
     if (delegate == nil)
         delegate = self.delegate;
     
-    // *** Upload Automatic ***
+    // *** Auto Upload ***
     
-    if ([selector isEqualToString:selectorUploadAutomatic]) {
+    if ([selector isEqualToString:selectorUploadAutoUpload]) {
         
         [self upload:fileName serverUrl:serverUrl cryptated:NO template:NO onlyPlist:NO fileNameTemplate:nil assetLocalIdentifier:assetLocalIdentifier session:session taskStatus:taskStatus selector:selector selectorPost:selectorPost errorCode:errorCode delegate:delegate];
     } else {
     
-        // *** Manual Upload & Upload Automatic All ***
+        // *** Manual Upload & Auto Upload All ***
         
         PHFetchResult *result = [PHAsset fetchAssetsWithLocalIdentifiers:@[assetLocalIdentifier] options:nil];
         
@@ -1266,9 +1266,9 @@
         
         [[NCManageDatabase sharedInstance] setMetadataSession:session sessionError:@"" sessionSelector:nil sessionSelectorPost:nil sessionTaskIdentifier:sessionTaskIdentifier sessionTaskIdentifierPlist:sessionTaskIdentifierPlist predicate:[NSPredicate predicateWithFormat:@"sessionID = %@ AND account = %@", sessionID, _activeAccount]];
         
-        // Delete record on Table Automatic Upload
-        if ([selector isEqualToString:selectorUploadAutomatic] || [selector isEqualToString:selectorUploadAutomaticAll])
-            [[NCManageDatabase sharedInstance] deleteAutomaticUploadWithAssetLocalIdentifier:assetLocalIdentifier];
+        // Delete record on Table Auto Upload
+        if ([selector isEqualToString:selectorUploadAutoUpload] || [selector isEqualToString:selectorUploadAutoUploadAll])
+            [[NCManageDatabase sharedInstance] deleteAutoUploadWithAssetLocalIdentifier:assetLocalIdentifier];
         
         // Manage uploadTask cancel,suspend,resume
         if (taskStatus == k_taskStatusCancel) [uploadTask cancel];
@@ -1431,8 +1431,8 @@
         if ([CCUtility getUploadAndRemovePhoto] || [metadata.sessionSelectorPost isEqualToString:selectorUploadRemovePhoto])
             [[NSFileManager defaultManager] removeItemAtPath:[NSString stringWithFormat:@"%@/%@", _directoryUser, metadata.fileID] error:nil];
         
-        // Copy photo or video in the photo album for automatic upload
-        if ([metadata.assetLocalIdentifier length] > 0 && [metadata.sessionSelector isEqualToString:selectorUploadAutomatic]) {
+        // Copy photo or video in the photo album for auto upload
+        if ([metadata.assetLocalIdentifier length] > 0 && [metadata.sessionSelector isEqualToString:selectorUploadAutoUpload]) {
             
             PHAsset *asset;
             PHFetchResult *result = [PHAsset fetchAssetsWithLocalIdentifiers:@[metadata.assetLocalIdentifier] options:nil];

+ 7 - 7
iOSClient/Photos/CCPhotos.m

@@ -1123,7 +1123,7 @@
     }
     
     // Create the folder for Photos & if request the subfolders
-    if(![app createFolderSubFolderAutomaticUploadFolderPhotos:autoUploadPath useSubFolder:useSubFolder assets:newItemsPHAssetToUpload selector:selectorUploadAutomaticAll]) {
+    if(![app createFolderSubFolderAutomaticUploadFolderPhotos:autoUploadPath useSubFolder:useSubFolder assets:newItemsPHAssetToUpload selector:selectorUploadAutoUploadAll]) {
             
         // end loading
         [_hud hideHud];
@@ -1167,11 +1167,11 @@
         metadataNet.action = actionUploadAsset;
         metadataNet.assetLocalIdentifier = asset.localIdentifier;
         if (assetsFull) {
-            metadataNet.selector = selectorUploadAutomaticAll;
+            metadataNet.selector = selectorUploadAutoUploadAll;
             metadataNet.selectorPost = selectorUploadRemovePhoto;
             metadataNet.priority = NSOperationQueuePriorityLow;
         } else {
-            metadataNet.selector = selectorUploadAutomatic;
+            metadataNet.selector = selectorUploadAutoUpload;
             metadataNet.selectorPost = nil;
             metadataNet.priority = NSOperationQueuePriorityNormal;
         }
@@ -1264,7 +1264,7 @@
 
                     [[NCManageDatabase sharedInstance] addActivityClient:metadataNet.fileName fileID:metadataNet.assetLocalIdentifier action:k_activityDebugActionUpload selector:metadataNet.selector note:note type:k_activityTypeFailure verbose:k_activityVerboseDefault activeUrl:app.activeUrl];
                     
-                    [[NCManageDatabase sharedInstance] deleteAutomaticUploadWithAssetLocalIdentifier:metadataNet.assetLocalIdentifier];
+                    [[NCManageDatabase sharedInstance] deleteAutoUploadWithAssetLocalIdentifier:metadataNet.assetLocalIdentifier];
                     
                 } else {
                     
@@ -1277,7 +1277,7 @@
 
 - (void)addDatabaseAutomaticUpload:(CCMetadataNet *)metadataNet assetDate:(NSDate *)assetDate assetMediaType:(PHAssetMediaType)assetMediaType
 {    
-    if ([[NCManageDatabase sharedInstance] addAutomaticUploadWithMetadataNet:metadataNet]) {
+    if ([[NCManageDatabase sharedInstance] addAutoUploadWithMetadataNet:metadataNet]) {
         
         [[NCManageDatabase sharedInstance] addActivityClient:metadataNet.fileName fileID:metadataNet.assetLocalIdentifier action:k_activityDebugActionAutomaticUpload selector:metadataNet.selector note:[NSString stringWithFormat:@"Add Automatic Upload, Asset Data: %@", [NSDateFormatter localizedStringFromDate:assetDate dateStyle:NSDateFormatterMediumStyle timeStyle:NSDateFormatterMediumStyle]] type:k_activityTypeInfo verbose:k_activityVerboseHigh activeUrl:app.activeUrl];
        
@@ -1288,8 +1288,8 @@
     
     dispatch_async(dispatch_get_main_queue(), ^{
         
-        // Update Camera Upload data
-        if ([metadataNet.selector isEqualToString:selectorUploadAutomatic])
+        // Update Camera Auto Upload data
+        if ([metadataNet.selector isEqualToString:selectorUploadAutoUpload])
             [[NCManageDatabase sharedInstance] setAccountAutoUploadDateAssetType:assetMediaType assetDate:assetDate];
         
         // Update icon badge number

+ 1 - 1
iOSClient/Settings/CCAdvanced.m

@@ -321,7 +321,7 @@
             [[NSURLCache sharedURLCache] setDiskCapacity:0];
 
             [[NCManageDatabase sharedInstance] clearTable:[tableActivity class] account:app.activeAccount];
-            [[NCManageDatabase sharedInstance] clearTable:[tableAutomaticUpload class] account:app.activeAccount];
+            [[NCManageDatabase sharedInstance] clearTable:[tableAutoUpload class] account:app.activeAccount];
             [[NCManageDatabase sharedInstance] clearTable:[tableCapabilities class] account:app.activeAccount];
             [[NCManageDatabase sharedInstance] clearTable:[tableDirectory class] account:app.activeAccount];
             [[NCManageDatabase sharedInstance] clearTable:[tableExternalSites class] account:app.activeAccount];

+ 2 - 2
iOSClient/Settings/CCManageAccount.m

@@ -314,7 +314,7 @@
     
     [[NCManageDatabase sharedInstance] clearTable:[tableAccount class] account:account];
     [[NCManageDatabase sharedInstance] clearTable:[tableActivity class] account:account];
-    [[NCManageDatabase sharedInstance] clearTable:[tableAutomaticUpload class] account:account];
+    [[NCManageDatabase sharedInstance] clearTable:[tableAutoUpload class] account:account];
     [[NCManageDatabase sharedInstance] clearTable:[tableCapabilities class] account:account];
     [[NCManageDatabase sharedInstance] clearTable:[tableDirectory class] account:app.activeAccount];
     [[NCManageDatabase sharedInstance] clearTable:[tableExternalSites class] account:account];
@@ -346,7 +346,7 @@
 
 - (void)ChangeDefaultAccount:(NSString *)account
 {
-    if ([app.netQueue operationCount] > 0 || [app.netQueueDownload operationCount] > 0 || [app.netQueueDownloadWWan operationCount] > 0 || [app.netQueueUpload operationCount] > 0 || [app.netQueueUploadWWan operationCount] > 0 || [[NCManageDatabase sharedInstance] countAutomaticUploadWithSession:nil] > 0) {
+    if ([app.netQueue operationCount] > 0 || [app.netQueueDownload operationCount] > 0 || [app.netQueueDownloadWWan operationCount] > 0 || [app.netQueueUpload operationCount] > 0 || [app.netQueueUploadWWan operationCount] > 0 || [[NCManageDatabase sharedInstance] countAutoUploadWithSession:nil] > 0) {
         
         [app messageNotification:@"_transfers_in_queue_" description:nil visible:YES delay:k_dismissAfterSecond type:TWMessageBarMessageTypeInfo errorCode:0];
         [self UpdateForm];

+ 2 - 2
iOSClient/Settings/CCManageAutoUpload.m

@@ -236,7 +236,7 @@
             [[NCManageDatabase sharedInstance] setAccountAutoUploadDateAssetType:PHAssetMediaTypeVideo assetDate:nil];
 
             // remove
-            [[NCManageDatabase sharedInstance] clearTable:[tableAutomaticUpload class] account:app.activeAccount];
+            [[NCManageDatabase sharedInstance] clearTable:[tableAutoUpload class] account:app.activeAccount];
         }
         
         // Initialize Auto Upload
@@ -282,7 +282,7 @@
             
         } else {
             
-            [[NCManageDatabase sharedInstance] clearTable:[tableAutomaticUpload class] account:app.activeAccount];
+            [[NCManageDatabase sharedInstance] clearTable:[tableAutoUpload class] account:app.activeAccount];
             [[NCManageDatabase sharedInstance] setAccountAutoUploadFiled:@"autoUploadFull" state:NO];
         }
     }

+ 8 - 8
iOSClient/Transfers/CCTransfers.m

@@ -340,10 +340,10 @@
     NSString *titleSection, *numberTitle;
     NSInteger typeOfSession = 0;
     
-    NSInteger queueDownload = [app getNumberDownloadInQueues] + [[NCManageDatabase sharedInstance] countAutomaticUploadWithSession:k_download_session];
-    NSInteger queueDownloadWWan = [app getNumberDownloadInQueuesWWan] + [[NCManageDatabase sharedInstance] countAutomaticUploadWithSession:k_download_session_wwan];
-    NSInteger queueUpload = [app getNumberUploadInQueues] + [[NCManageDatabase sharedInstance] countAutomaticUploadWithSession:k_upload_session];
-    NSInteger queueUploadWWan = [app getNumberUploadInQueuesWWan] + [[NCManageDatabase sharedInstance] countAutomaticUploadWithSession:k_upload_session_wwan];
+    NSInteger queueDownload = [app getNumberDownloadInQueues] + [[NCManageDatabase sharedInstance] countAutoUploadWithSession:k_download_session];
+    NSInteger queueDownloadWWan = [app getNumberDownloadInQueuesWWan] + [[NCManageDatabase sharedInstance] countAutoUploadWithSession:k_download_session_wwan];
+    NSInteger queueUpload = [app getNumberUploadInQueues] + [[NCManageDatabase sharedInstance] countAutoUploadWithSession:k_upload_session];
+    NSInteger queueUploadWWan = [app getNumberUploadInQueuesWWan] + [[NCManageDatabase sharedInstance] countAutoUploadWithSession:k_upload_session_wwan];
     
     if ([[_sectionDataSource.sections objectAtIndex:section] isKindOfClass:[NSString class]]) titleSection = [_sectionDataSource.sections objectAtIndex:section];
     if ([[_sectionDataSource.sections objectAtIndex:section] isKindOfClass:[NSDate class]]) titleSection = [CCUtility getTitleSectionDate:[_sectionDataSource.sections objectAtIndex:section]];
@@ -425,7 +425,7 @@
     // Footer Download
     if ([titleSection containsString:@"download"] && ![titleSection containsString:@"wwan"] && titleSection != nil) {
         
-        NSInteger queueDownload = [app getNumberDownloadInQueues] + [[NCManageDatabase sharedInstance] countAutomaticUploadWithSession:k_download_session];
+        NSInteger queueDownload = [app getNumberDownloadInQueues] + [[NCManageDatabase sharedInstance] countAutoUploadWithSession:k_download_session];
         
         // element or elements ?
         if (queueDownload > 1) element_s = NSLocalizedString(@"_elements_",nil);
@@ -442,7 +442,7 @@
     // Footer Download WWAN
     if ([titleSection containsString:@"download"] && [titleSection containsString:@"wwan"] && titleSection != nil) {
         
-        NSInteger queueDownloadWWan = [app getNumberDownloadInQueuesWWan] + [[NCManageDatabase sharedInstance] countAutomaticUploadWithSession:k_download_session_wwan];
+        NSInteger queueDownloadWWan = [app getNumberDownloadInQueuesWWan] + [[NCManageDatabase sharedInstance] countAutoUploadWithSession:k_download_session_wwan];
         
         // element or elements ?
         if (queueDownloadWWan > 1) element_s = NSLocalizedString(@"_elements_",nil);
@@ -463,7 +463,7 @@
     // Footer Upload
     if ([titleSection containsString:@"upload"] && ![titleSection containsString:@"wwan"] && titleSection != nil) {
         
-        NSInteger queueUpload = [app getNumberUploadInQueues] + [[NCManageDatabase sharedInstance] countAutomaticUploadWithSession:k_upload_session];
+        NSInteger queueUpload = [app getNumberUploadInQueues] + [[NCManageDatabase sharedInstance] countAutoUploadWithSession:k_upload_session];
         
         // element or elements ?
         if (queueUpload > 1) element_s = NSLocalizedString(@"_elements_",nil);
@@ -480,7 +480,7 @@
     // Footer Upload WWAN
     if ([titleSection containsString:@"upload"] && [titleSection containsString:@"wwan"] && titleSection != nil) {
         
-        NSInteger queueUploadWWan = [app getNumberUploadInQueuesWWan] + [[NCManageDatabase sharedInstance] countAutomaticUploadWithSession:k_upload_session_wwan];
+        NSInteger queueUploadWWan = [app getNumberUploadInQueuesWWan] + [[NCManageDatabase sharedInstance] countAutoUploadWithSession:k_upload_session_wwan];
         
         // element or elements ?
         if (queueUploadWWan > 1) element_s = NSLocalizedString(@"_elements_",nil);