Эх сурвалжийг харах

change func countAutomaticUploadForAccount

Marino Faggiana 8 жил өмнө
parent
commit
cebd878cac

+ 1 - 1
iOSClient/AppDelegate.m

@@ -936,7 +936,7 @@
     NSInteger queueUpload = [self getNumberUploadInQueues] + [self getNumberUploadInQueuesWWan];
     
     // Total
-    NSInteger total = queueDownload + queueUpload + [[NCManageDatabase sharedInstance] countAutomaticUploadForAccount:app.activeAccount selector:nil];
+    NSInteger total = queueDownload + queueUpload + [[NCManageDatabase sharedInstance] countAutomaticUploadForAccount:app.activeAccount session:nil];
     
     [UIApplication sharedApplication].applicationIconBadgeNumber = total;
     

+ 3 - 3
iOSClient/FileSystem/NCManageDatabase.swift

@@ -412,18 +412,18 @@ class NCManageDatabase: NSObject {
         }
     }
     
-    func countAutomaticUploadForAccount(_ account: String, selector: String?) -> Int {
+    func countAutomaticUploadForAccount(_ account: String, session: String?) -> Int {
         
         let realm = try! Realm()
         let results : Results<tableAutomaticUpload>
         
-        if (selector == nil) {
+        if (session == nil) {
             
             results = realm.objects(tableAutomaticUpload.self).filter("account = %@", account)
             
         } else {
             
-            results = realm.objects(tableAutomaticUpload.self).filter("account = %@ AND selector = %@", account, selector!)
+            results = realm.objects(tableAutomaticUpload.self).filter("account = %@ AND session = %@", account, session!)
         }
         
         return results.count

+ 1 - 1
iOSClient/Main/CCMain.m

@@ -3285,7 +3285,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] countAutomaticUploadForAccount:app.activeAccount selector: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] countAutomaticUploadForAccount:app.activeAccount session:nil] > 0) {
         
         [app messageNotification:@"_transfers_in_queue_" description:nil visible:YES delay:k_dismissAfterSecond type:TWMessageBarMessageTypeInfo errorCode:0];
         return;

+ 1 - 1
iOSClient/Settings/CCManageAccount.m

@@ -351,7 +351,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] countAutomaticUploadForAccount:app.activeAccount selector: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] countAutomaticUploadForAccount:app.activeAccount session:nil] > 0) {
         
         [app messageNotification:@"_transfers_in_queue_" description:nil visible:YES delay:k_dismissAfterSecond type:TWMessageBarMessageTypeInfo errorCode:0];
         [self UpdateForm];