File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -179,6 +179,10 @@ - (void)getAssetsForUpload {
179179 return ;
180180 }
181181
182+ if (![[NSFileManager defaultManager ] fileExistsAtPath: NSTemporaryDirectory ()]) {
183+ [[NSFileManager defaultManager ] createDirectoryAtPath: NSTemporaryDirectory () withIntermediateDirectories: YES attributes: nil error: nil ];
184+ }
185+
182186 if ([[[UIDevice currentDevice ] systemVersion ] floatValue ] >= 8.0 ) {
183187 PHFetchResult *assetsFetchResult = nil ;
184188
@@ -193,16 +197,15 @@ - (void)getAssetsForUpload {
193197
194198 MEGALogInfo (@" Retrieved assets %ld " , assetsFetchResult.count );
195199
196- for (PHAsset *asset in assetsFetchResult ) {
200+ [assetsFetchResult enumerateObjectsUsingBlock: ^ (PHAsset *asset, NSUInteger index, BOOL *stop ) {
197201 if (asset.mediaType == PHAssetMediaTypeVideo && self.isUploadVideosEnabled && ([asset.creationDate timeIntervalSince1970 ] > [self .lastUploadVideoDate timeIntervalSince1970 ])) {
198202 MEGAAssetOperation *uploadAssetsOperation = [[MEGAAssetOperation alloc ] initWithPHAsset: asset parentNode: cameraUploadsNode automatically: YES ];
199203 [_assetsOperationQueue addOperation: uploadAssetsOperation];
200204 } else if (asset.mediaType == PHAssetMediaTypeImage && ([asset.creationDate timeIntervalSince1970 ] > [self .lastUploadPhotoDate timeIntervalSince1970 ])) {
201205 MEGAAssetOperation *uploadAssetsOperation = [[MEGAAssetOperation alloc ] initWithPHAsset: asset parentNode: cameraUploadsNode automatically: YES ];
202206 [_assetsOperationQueue addOperation: uploadAssetsOperation];
203- }
204- }
205-
207+ }
208+ }];
206209 } else {
207210 __block NSInteger totalAssets = 0 ;
208211
You can’t perform that action at this time.
0 commit comments