Browse Source

new getCameraRollNewItemsWithDatePhoto

Marino Faggiana 7 years ago
parent
commit
115da246a9

+ 0 - 6
Nextcloud.xcodeproj/project.pbxproj

@@ -417,7 +417,6 @@
 		F77B0E8F1D118A16002130FE /* CCSection.m in Sources */ = {isa = PBXBuildFile; fileRef = F78F6FAF1CC8CCB700F4EA25 /* CCSection.m */; };
 		F77B0E911D118A16002130FE /* CCTemplates.m in Sources */ = {isa = PBXBuildFile; fileRef = F72137301BAFF0920012B613 /* CCTemplates.m */; };
 		F77B0E921D118A16002130FE /* CCCellMainTransfer.m in Sources */ = {isa = PBXBuildFile; fileRef = F70211F81BAC56E9003FC03E /* CCCellMainTransfer.m */; };
-		F77B0E951D118A16002130FE /* CCManageAsset.m in Sources */ = {isa = PBXBuildFile; fileRef = F7BFCCBF1B68C21900548E76 /* CCManageAsset.m */; };
 		F77B0E981D118A16002130FE /* CCManageAccount.m in Sources */ = {isa = PBXBuildFile; fileRef = F7ACE42D1BAC0268006C0017 /* CCManageAccount.m */; };
 		F77B0E991D118A16002130FE /* PPCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F051F1C889184008DAB36 /* PPCollectionViewCell.m */; };
 		F77B0E9B1D118A16002130FE /* CCBKPasscode.m in Sources */ = {isa = PBXBuildFile; fileRef = F7FE125D1BAC03FB0041924B /* CCBKPasscode.m */; };
@@ -1667,8 +1666,6 @@
 		F7BF1B3F1D51E893000854F6 /* CCLogin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLogin.h; sourceTree = "<group>"; };
 		F7BF1B401D51E893000854F6 /* CCLogin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCLogin.m; sourceTree = "<group>"; };
 		F7BFA4541E0693EE0010E44C /* cryptocloud 5.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "cryptocloud 5.xcdatamodel"; sourceTree = "<group>"; };
-		F7BFCCBE1B68C21900548E76 /* CCManageAsset.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCManageAsset.h; sourceTree = "<group>"; };
-		F7BFCCBF1B68C21900548E76 /* CCManageAsset.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCManageAsset.m; sourceTree = "<group>"; };
 		F7BFCCC01B68C21900548E76 /* CCManageLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCManageLocation.h; sourceTree = "<group>"; };
 		F7BFCCC11B68C21900548E76 /* CCManageLocation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCManageLocation.m; sourceTree = "<group>"; };
 		F7C00D4A1E2D10BB0032160B /* cryptocloud 7.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "cryptocloud 7.xcdatamodel"; sourceTree = "<group>"; };
@@ -3314,8 +3311,6 @@
 		F7BFCCBD1B68C21900548E76 /* ManageLocation+ManageAsset */ = {
 			isa = PBXGroup;
 			children = (
-				F7BFCCBE1B68C21900548E76 /* CCManageAsset.h */,
-				F7BFCCBF1B68C21900548E76 /* CCManageAsset.m */,
 				F7BFCCC01B68C21900548E76 /* CCManageLocation.h */,
 				F7BFCCC11B68C21900548E76 /* CCManageLocation.m */,
 				F777F0301C29717F00CE81CB /* PHAsset+Utility.h */,
@@ -4616,7 +4611,6 @@
 				F72AAECD1E5C60C700BB17E1 /* UIWindow+AHKAdditions.m in Sources */,
 				F77B0E921D118A16002130FE /* CCCellMainTransfer.m in Sources */,
 				F7659A5C1DC0B760004860C4 /* PSTCollectionViewCell.m in Sources */,
-				F77B0E951D118A16002130FE /* CCManageAsset.m in Sources */,
 				F7659A391DC0B737004860C4 /* iRate.m in Sources */,
 				F7B1FBC81E72E3D1001781FE /* SwiftWebVCActivity.swift in Sources */,
 				F77B0E981D118A16002130FE /* CCManageAccount.m in Sources */,

+ 0 - 1
iOSClient/AppDelegate.m

@@ -29,7 +29,6 @@
 #import "AFURLSessionManager.h"
 #import "CCNetworking.h"
 #import "CCCrypto.h"
-#import "CCManageAsset.h"
 #import "CCGraphics.h"
 #import "CCPhotos.h"
 #import "CCSynchronize.h"

+ 1 - 2
iOSClient/AutoUpload/NCAutoUpload.h

@@ -23,7 +23,6 @@
 
 #import <Foundation/Foundation.h>
 #import <Photos/Photos.h>
-#import "CCManageAsset.h"
 #import "CCManageAutoUpload.h"
 #import "NCRequestAsset.h"
 
@@ -37,6 +36,6 @@
 
 - (void)loadAutoUpload:(NSNumber *)maxConcurrent;
 
-- (BOOL)createFolderSubFolderAutoUploadFolderPhotos:(NSString *)folderPhotos useSubFolder:(BOOL)useSubFolder assets:(NSArray *)assets selector:(NSString *)selector;
+- (BOOL)createFolderSubFolderAutoUploadFolderPhotos:(NSString *)folderPhotos useSubFolder:(BOOL)useSubFolder assets:(PHFetchResult *)assets selector:(NSString *)selector;
 
 @end

+ 77 - 81
iOSClient/AutoUpload/NCAutoUpload.m

@@ -121,11 +121,7 @@
         
         [[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];
+        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];
         [alert show];
     }
 }
@@ -151,11 +147,7 @@
         
         [[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];
+        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];
         [alert show];
     }
 }
@@ -188,20 +180,12 @@
                     if (account.autoUploadBackground == YES)
                         [[NCManageDatabase sharedInstance] setAccountAutoUploadFiled:@"autoUploadBackground" state:NO];
                     
-                    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"_location_not_enabled_", nil)
-                                                                    message:NSLocalizedString(@"_location_not_enabled_msg_", nil)
-                                                                   delegate:nil
-                                                          cancelButtonTitle:NSLocalizedString(@"_ok_", nil)
-                                                          otherButtonTitles:nil];
+                    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"_location_not_enabled_", nil) message:NSLocalizedString(@"_location_not_enabled_msg_", nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"_ok_", nil) otherButtonTitles:nil];
                     [alert show];
                     
                 } else {
                     
-                    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];
+                    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];
                     [alert show];
                 }
             }
@@ -222,11 +206,7 @@
                 
                 [[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];
+                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];
                 [alert show];
             }
         }
@@ -239,20 +219,12 @@
         [[CCManageLocation sharedInstance] stopSignificantChangeUpdates];
         
         if ([ALAssetsLibrary authorizationStatus] == ALAuthorizationStatusAuthorized) {
-            UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"_location_not_enabled_", nil)
-                                                            message:NSLocalizedString(@"_location_not_enabled_msg_", nil)
-                                                           delegate:nil
-                                                  cancelButtonTitle:NSLocalizedString(@"_ok_", nil)
-                                                  otherButtonTitles:nil];
+            UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"_location_not_enabled_", nil) message:NSLocalizedString(@"_location_not_enabled_msg_", nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"_ok_", nil) otherButtonTitles:nil];
             [alert show];
             
         } else {
             
-            UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"_access_photo_location_not_enabled_", nil)
-                                                            message:NSLocalizedString(@"_access_photo_location_not_enabled_msg_", nil)
-                                                           delegate:nil
-                                                  cancelButtonTitle:NSLocalizedString(@"_ok_", nil)
-                                                  otherButtonTitles:nil];
+            UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"_access_photo_location_not_enabled_", nil) message:NSLocalizedString(@"_access_photo_location_not_enabled_msg_", nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"_ok_", nil) otherButtonTitles:nil];
             [alert show];
         }
     }
@@ -294,11 +266,7 @@
                 
             } else {
                 
-                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];
+                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];
                 [alert show];
             }
             
@@ -311,19 +279,11 @@
                 [[CCManageLocation sharedInstance] stopSignificantChangeUpdates];
                 
                 if ([ALAssetsLibrary authorizationStatus] == ALAuthorizationStatusAuthorized) {
-                    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"_location_not_enabled_", nil)
-                                                                    message:NSLocalizedString(@"_location_not_enabled_msg_", nil)
-                                                                   delegate:nil
-                                                          cancelButtonTitle:NSLocalizedString(@"_ok_", nil)
-                                                          otherButtonTitles:nil];
+                    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"_location_not_enabled_", nil) message:NSLocalizedString(@"_location_not_enabled_msg_", nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"_ok_", nil) otherButtonTitles:nil];
                     [alert show];
                     
                 } else {
-                    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"_access_photo_location_not_enabled_", nil)
-                                                                    message:NSLocalizedString(@"_access_photo_location_not_enabled_msg_", nil)
-                                                                   delegate:nil
-                                                          cancelButtonTitle:NSLocalizedString(@"_ok_", nil)
-                                                          otherButtonTitles:nil];
+                    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"_access_photo_location_not_enabled_", nil) message:NSLocalizedString(@"_access_photo_location_not_enabled_msg_", nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"_ok_", nil) otherButtonTitles:nil];
                     [alert show];
                 }
             }
@@ -383,32 +343,31 @@
 
 - (void)uploadAssetsNewAndFull:(BOOL)assetsFull
 {
-    CCManageAsset *manageAsset = [[CCManageAsset alloc] init];
-    NSMutableArray *newItemsToUpload;
-    tableAccount *tableAccount = [[NCManageDatabase sharedInstance] getAccountActive];
+    PHFetchResult *newAssetToUpload;
+    tableAccount *account = [[NCManageDatabase sharedInstance] getAccountActive];
     
     // Check Asset : NEW or FULL
     if (assetsFull) {
         
-        newItemsToUpload = [manageAsset getCameraRollNewItemsWithDatePhoto:[NSDate distantPast] dateVideo:[NSDate distantPast]];
+        newAssetToUpload = [self getCameraRollNewItemsWithDatePhoto:[NSDate distantPast] dateVideo:[NSDate distantPast] account:account];
         
     } else {
         
-        NSDate *databaseDatePhoto = tableAccount.autoUploadDatePhoto;
-        NSDate *databaseDateVideo = tableAccount.autoUploadDateVideo;
+        NSDate *databaseDatePhoto = account.autoUploadDatePhoto;
+        NSDate *databaseDateVideo = account.autoUploadDateVideo;
         
-        newItemsToUpload = [manageAsset getCameraRollNewItemsWithDatePhoto:databaseDatePhoto dateVideo:databaseDateVideo];
+        newAssetToUpload = [self getCameraRollNewItemsWithDatePhoto:databaseDatePhoto dateVideo:databaseDateVideo account:account];
     }
     
     // News Assets ? if no verify if blocked Table Auto Upload -> Autostart
-    if ([newItemsToUpload count] == 0) {
+    if ([newAssetToUpload count] == 0) {
         
-        NSLog(@"[LOG] Auto upload, no new asset found for date image %@, date video %@", tableAccount.autoUploadDatePhoto, tableAccount.autoUploadDateVideo);
+        NSLog(@"[LOG] Auto upload, no new asset found for date image %@, date video %@", account.autoUploadDatePhoto, account.autoUploadDateVideo);
         return;
         
     } else {
         
-        NSLog(@"[LOG] Auto upload, new %lu asset found for date image %@, date video %@", (unsigned long)[newItemsToUpload count], tableAccount.autoUploadDatePhoto, tableAccount.autoUploadDateVideo);
+        NSLog(@"[LOG] Auto upload, new %lu asset found for date image %@, date video %@", (unsigned long)[newAssetToUpload count], account.autoUploadDatePhoto, account.autoUploadDateVideo);
     }
     
     if (assetsFull) {
@@ -422,43 +381,32 @@
     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.01 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void) {
         
         if (assetsFull)
-            [self performSelectorOnMainThread:@selector(uploadFullAssetsToNetwork:) withObject:newItemsToUpload waitUntilDone:NO];
+            [self performSelectorOnMainThread:@selector(uploadFullAssetsToNetwork:) withObject:newAssetToUpload waitUntilDone:NO];
         else
-            [self performSelectorOnMainThread:@selector(uploadNewAssetsToNetwork:) withObject:newItemsToUpload waitUntilDone:NO];
+            [self performSelectorOnMainThread:@selector(uploadNewAssetsToNetwork:) withObject:newAssetToUpload waitUntilDone:NO];
     });
 }
 
-- (void)uploadNewAssetsToNetwork:(NSMutableArray *)newItemsToUpload
+- (void)uploadNewAssetsToNetwork:(PHFetchResult *)newAssetToUpload
 {
-    [self uploadAssetsToNetwork:newItemsToUpload assetsFull:NO];
+    [self uploadAssetsToNetwork:newAssetToUpload assetsFull:NO];
 }
 
-- (void)uploadFullAssetsToNetwork:(NSMutableArray *)newItemsToUpload
+- (void)uploadFullAssetsToNetwork:(PHFetchResult *)newAssetToUpload
 {
-    [self uploadAssetsToNetwork:newItemsToUpload assetsFull:YES];
+    [self uploadAssetsToNetwork:newAssetToUpload assetsFull:YES];
 }
 
-- (void)uploadAssetsToNetwork:(NSMutableArray *)newItemsToUpload assetsFull:(BOOL)assetsFull
+- (void)uploadAssetsToNetwork:(PHFetchResult *)newAssetToUpload assetsFull:(BOOL)assetsFull
 {
-    NSMutableArray *newItemsPHAssetToUpload = [[NSMutableArray alloc] init];
     tableAccount *tableAccount = [[NCManageDatabase sharedInstance] getAccountActive];
     NSMutableArray *metadataNetFull = [NSMutableArray new];
   
     NSString *autoUploadPath = [[NCManageDatabase sharedInstance] getAccountAutoUploadPath:app.activeUrl];
     BOOL useSubFolder = tableAccount.autoUploadCreateSubfolder;
     
-    // Conversion from ALAsset [OLD < iOS 8] - to -> PHAsset
-    for (ALAsset *asset in newItemsToUpload) {
-        
-        NSURL *url = [asset valueForProperty:@"ALAssetPropertyAssetURL"];
-        PHFetchResult *fetchResult = [PHAsset fetchAssetsWithALAssetURLs:@[url] options:nil];
-        PHAsset *asset = [fetchResult firstObject];
-        [newItemsPHAssetToUpload addObject:asset];
-        NSLog(@"Convert url %@", url);
-    }
-    
     // Create the folder for Photos & if request the subfolders
-    if(![[NCAutoUpload sharedInstance] createFolderSubFolderAutoUploadFolderPhotos:autoUploadPath useSubFolder:useSubFolder assets:newItemsPHAssetToUpload selector:selectorUploadAutoUploadAll]) {
+    if(![[NCAutoUpload sharedInstance] createFolderSubFolderAutoUploadFolderPhotos:autoUploadPath useSubFolder:useSubFolder assets:newAssetToUpload selector:selectorUploadAutoUploadAll]) {
         
         // end loading
         [_hud hideHud];
@@ -466,7 +414,7 @@
         return;
     }
     
-    for (PHAsset *asset in newItemsPHAssetToUpload) {
+    for (PHAsset *asset in newAssetToUpload) {
         
         NSString *serverUrl;
         NSDate *assetDate = asset.creationDate;
@@ -668,7 +616,7 @@
 #pragma mark ===== Create Folder SubFolder Auto Upload Folder Photos ====
 #pragma --------------------------------------------------------------------------------------------
 
-- (BOOL)createFolderSubFolderAutoUploadFolderPhotos:(NSString *)folderPhotos useSubFolder:(BOOL)useSubFolder assets:(NSArray *)assets selector:(NSString *)selector
+- (BOOL)createFolderSubFolderAutoUploadFolderPhotos:(NSString *)folderPhotos useSubFolder:(BOOL)useSubFolder assets:(PHFetchResult *)assets selector:(NSString *)selector
 {
     OCnetworking *ocNetworking = [[OCnetworking alloc] initWithDelegate:nil metadataNet:nil withUser:app.activeUser withPassword:app.activePassword withUrl:app.activeUrl isCryptoCloudMode:NO];
     
@@ -710,5 +658,53 @@
     return true;
 }
 
+#pragma --------------------------------------------------------------------------------------------
+#pragma mark ===== XXX ====
+#pragma --------------------------------------------------------------------------------------------
+
+- (PHFetchResult *)getCameraRollNewItemsWithDatePhoto:(NSDate *)datePhoto dateVideo:(NSDate *)dateVideo account:(tableAccount *)account
+{
+    @synchronized(self) {
+ 
+        if ([PHPhotoLibrary authorizationStatus] == PHAuthorizationStatusAuthorized) {
+            
+            PHFetchResult *result = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:PHAssetCollectionSubtypeSmartAlbumUserLibrary options:nil];
+                    
+            NSPredicate *predicateImage = [NSCompoundPredicate andPredicateWithSubpredicates:@[[NSPredicate predicateWithFormat:@"mediaType = %i", PHAssetMediaTypeImage], [NSPredicate predicateWithFormat:@"creationDate > %@", datePhoto]]];
+            
+            NSPredicate *predicateVideo = [NSCompoundPredicate andPredicateWithSubpredicates:@[[NSPredicate predicateWithFormat:@"mediaType = %i", PHAssetMediaTypeVideo], [NSPredicate predicateWithFormat:@"creationDate > %@", dateVideo]]];
+                    
+            NSPredicate *predicate;
+            
+            if (account.autoUploadPhoto && account.autoUploadVideo) {
+                
+                predicate = [NSCompoundPredicate orPredicateWithSubpredicates:@[predicateImage, predicateVideo]];
+                
+            } else if (account.autoUploadPhoto) {
+                
+                predicate = predicateImage;
+                
+            } else if (account.autoUploadVideo) {
+                
+                predicate = predicateVideo;
+            }
+                    
+            PHFetchOptions *newInstantUploadAssetsFetchOptions = [PHFetchOptions new];
+            newInstantUploadAssetsFetchOptions.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"creationDate" ascending:YES]];
+            newInstantUploadAssetsFetchOptions.predicate = predicate;
+                    
+            PHFetchResult *newAssetToUpload = [PHAsset fetchAssetsInAssetCollection:result[0] options:newInstantUploadAssetsFetchOptions];
+            
+            return newAssetToUpload;
+            
+        } else {
+            
+            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];
+            [alert show];
+        }
+    }
+    
+    return nil;
+}
 
 @end

+ 1 - 1
iOSClient/Brand/Picker.plist

@@ -19,7 +19,7 @@
 	<key>CFBundleShortVersionString</key>
 	<string>2.17.4</string>
 	<key>CFBundleVersion</key>
-	<string>00018</string>
+	<string>00019</string>
 	<key>NSExtension</key>
 	<dict>
 		<key>NSExtensionAttributes</key>

+ 1 - 1
iOSClient/Brand/PickerFileProvider.plist

@@ -19,7 +19,7 @@
 	<key>CFBundleShortVersionString</key>
 	<string>2.17.4</string>
 	<key>CFBundleVersion</key>
-	<string>00018</string>
+	<string>00019</string>
 	<key>NSExtension</key>
 	<dict>
 		<key>NSExtensionFileProviderDocumentGroup</key>

+ 1 - 1
iOSClient/Brand/Share.plist

@@ -19,7 +19,7 @@
 	<key>CFBundleShortVersionString</key>
 	<string>2.17.4</string>
 	<key>CFBundleVersion</key>
-	<string>00018</string>
+	<string>00019</string>
 	<key>NSAppTransportSecurity</key>
 	<dict>
 		<key>NSAllowsArbitraryLoads</key>

+ 1 - 1
iOSClient/Brand/iOSClient.plist

@@ -69,7 +69,7 @@
 		</dict>
 	</array>
 	<key>CFBundleVersion</key>
-	<string>00018</string>
+	<string>00019</string>
 	<key>Fabric</key>
 	<dict>
 		<key>APIKey</key>

+ 1 - 1
iOSClient/Main/CCMain.m

@@ -1739,7 +1739,7 @@
     NSString *directoryID = [[NCManageDatabase sharedInstance] getDirectoryID:serverUrl];
     
     // Create the folder for Photos & if request the subfolders
-    if (![[NCAutoUpload sharedInstance] createFolderSubFolderAutoUploadFolderPhotos:autoUploadPath useSubFolder:useSubFolder assets:assets selector:selectorUploadFile])
+    if (![[NCAutoUpload sharedInstance] createFolderSubFolderAutoUploadFolderPhotos:autoUploadPath useSubFolder:useSubFolder assets:(PHFetchResult *)assets selector:selectorUploadFile])
         return;
     
     NSLog(@"[LOG] Asset N. %lu", (unsigned long)[assets count]);

+ 1 - 1
iOSClient/Utility/CCUtility.h

@@ -161,7 +161,7 @@
 
 + (void)sendMailEncryptPass:(NSString *)recipient validateEmail:(BOOL)validateEmail form:(id)form nameImage:(NSString *)nameImage;
 
-+ (NSArray *)createNameSubFolder:(NSArray *)assets;
++ (NSArray *)createNameSubFolder:(PHFetchResult *)assets;
 
 // ===== CCMetadata =====
 

+ 1 - 1
iOSClient/Utility/CCUtility.m

@@ -735,7 +735,7 @@
     }
 }
 
-+ (NSArray *)createNameSubFolder:(NSArray *)alassets
++ (NSArray *)createNameSubFolder:(PHFetchResult *)alassets
 {
     NSMutableOrderedSet *datesSubFolder = [NSMutableOrderedSet new];