Răsfoiți Sursa

remove old code

Marino Faggiana 7 ani în urmă
părinte
comite
f13d21e27a

+ 0 - 3
iOSClient/AppDelegate.m

@@ -365,9 +365,6 @@
         NSLog(@"[LOG] Listning Favorites");
         [_activeFavorites readListingFavorites];
     });
-    
-    // Initialize Auto upload
-    //[[NSNotificationCenter defaultCenter] postNotificationName:@"initStateAutoUpload" object:@{@"afterDelay": @(2)}];
 }
 
 #pragma --------------------------------------------------------------------------------------------

+ 1 - 1
iOSClient/AutoUpload/NCAutoUpload.h

@@ -28,7 +28,7 @@
 
 @class tableAccount;
 
-@interface NCAutoUpload : NSObject <PHPhotoLibraryChangeObserver, CCManageLocationDelegate, NCRequestAssetDelegate>
+@interface NCAutoUpload : NSObject <CCManageLocationDelegate, NCRequestAssetDelegate>
 
 + (NCAutoUpload *)sharedInstance;
 

+ 2 - 37
iOSClient/AutoUpload/NCAutoUpload.m

@@ -29,8 +29,6 @@
 
 @interface NCAutoUpload ()
 {
-    PHFetchResult *_assetsFetchResult;
-
     CCHud *_hud;
 }
 @end
@@ -51,26 +49,6 @@
     }
 }
 
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ==== Photo Library Change Observer ====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)photoLibraryDidChange:(PHChange *)changeInfo
-{
-    /*
-     PHFetchResultChangeDetails *collectionChanges = [changeInfo changeDetailsForFetchResult:self.assetsFetchResult];
-     
-     if (collectionChanges) {
-     
-     self.assetsFetchResult = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum | PHAssetCollectionTypeAlbum subtype:PHAssetCollectionSubtypeAny options:nil];
-     
-     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.5 * NSEC_PER_SEC), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void) {
-     [self uploadNewAssets];
-     });
-     }
-     */
-}
-
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark === initStateAutoUpload ===
 #pragma --------------------------------------------------------------------------------------------
@@ -89,8 +67,6 @@
         }
         
     } else {
-                
-        [PHPhotoLibrary.sharedPhotoLibrary unregisterChangeObserver:self];
         
         [[CCManageLocation sharedInstance] stopSignificantChangeUpdates];
     }
@@ -104,10 +80,6 @@
 {
     if ([ALAssetsLibrary authorizationStatus] == ALAuthorizationStatusAuthorized) {
         
-        _assetsFetchResult = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum | PHAssetCollectionTypeAlbum subtype:PHAssetCollectionSubtypeAny options:nil];
-        
-        [PHPhotoLibrary.sharedPhotoLibrary registerChangeObserver:self];
-        
         [self performSelectorOnMainThread:@selector(uploadNewAssets) withObject:nil waitUntilDone:NO];
         
     } else {
@@ -117,8 +89,6 @@
         if (account.autoUpload == YES)
             [[NCManageDatabase sharedInstance] setAccountAutoUploadFiled:@"autoUpload" state:NO];
         
-        [PHPhotoLibrary.sharedPhotoLibrary unregisterChangeObserver:self];
-        
         [[CCManageLocation sharedInstance] stopSignificantChangeUpdates];
         
         UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"_access_photo_not_enabled_", nil) message:NSLocalizedString(@"_access_photo_not_enabled_msg_", nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"_ok_", nil) otherButtonTitles:nil];
@@ -130,10 +100,6 @@
 {
     if ([ALAssetsLibrary authorizationStatus] == ALAuthorizationStatusAuthorized) {
         
-        _assetsFetchResult = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum | PHAssetCollectionTypeAlbum subtype:PHAssetCollectionSubtypeAny options:nil];
-        
-        [PHPhotoLibrary.sharedPhotoLibrary registerChangeObserver:self];
-        
         [self performSelectorOnMainThread:@selector(uploadFullAssets) withObject:nil waitUntilDone:NO];
         
     } else {
@@ -143,8 +109,6 @@
         if (account.autoUpload == YES)
             [[NCManageDatabase sharedInstance] setAccountAutoUploadFiled:@"autoUpload" state:NO];
         
-        [PHPhotoLibrary.sharedPhotoLibrary unregisterChangeObserver:self];
-        
         [[CCManageLocation sharedInstance] stopSignificantChangeUpdates];
         
         UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"_access_photo_not_enabled_", nil) message:NSLocalizedString(@"_access_photo_not_enabled_msg_", nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"_ok_", nil) otherButtonTitles:nil];
@@ -322,7 +286,6 @@
                 [[NCManageDatabase sharedInstance] setAccountAutoUploadFiled:@"autoUploadBackground" state:NO];
             
             [[CCManageLocation sharedInstance] stopSignificantChangeUpdates];
-            [PHPhotoLibrary.sharedPhotoLibrary unregisterChangeObserver:self];
         }
     }
 }
@@ -749,6 +712,8 @@
 
         PHFetchResult *assets = [self getCameraRollAssets:account assetsFull:YES];
         [[NCManageDatabase sharedInstance] addPhotoLibrary:(NSArray *)assets];
+        
+        NSLog(@"Align Photo Library %lu", [assets count]);
     });
 }
 

+ 0 - 3
iOSClient/Settings/CCManageAutoUpload.m

@@ -233,9 +233,6 @@
             [[NCManageDatabase sharedInstance] clearTable:[tableAutoUpload class] account:app.activeAccount];
         }
         
-        // Initialize Auto Upload
-        [[NCAutoUpload sharedInstance] initStateAutoUpload];
-        
         [self reloadForm];
     }