Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/ios.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarino Faggiana <m.faggiana@twsweb.it>2017-06-23 16:49:48 +0300
committerGitHub <noreply@github.com>2017-06-23 16:49:48 +0300
commitffd75a92eb91e6b6aa6d4f47c42beaeaa0bd848b (patch)
tree88e3f31442a16e04465377e08a8de59ef8571a75 /iOSClient/ManageLocation+ManageAsset
parentdd541edc090e4528f6ebdc5b44720c4dce027b46 (diff)
Delete CCManageAsset.m
Diffstat (limited to 'iOSClient/ManageLocation+ManageAsset')
-rwxr-xr-xiOSClient/ManageLocation+ManageAsset/CCManageAsset.m168
1 files changed, 0 insertions, 168 deletions
diff --git a/iOSClient/ManageLocation+ManageAsset/CCManageAsset.m b/iOSClient/ManageLocation+ManageAsset/CCManageAsset.m
deleted file mode 100755
index 915b78cad..000000000
--- a/iOSClient/ManageLocation+ManageAsset/CCManageAsset.m
+++ /dev/null
@@ -1,168 +0,0 @@
-//
-// CCManageAsset.m
-// Crypto Cloud Technology Nextcloud
-//
-// Created by Marino Faggiana on 23/07/15.
-// Copyright (c) 2017 TWS. All rights reserved.
-//
-// Author Marino Faggiana <m.faggiana@twsweb.it>
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import "CCManageAsset.h"
-#import "AppDelegate.h"
-#import "NCBridgeSwift.h"
-
-@implementation CCManageAsset
-
-- (NSMutableArray *)getCameraRollNewItemsWithDatePhoto:(NSDate *)datePhoto dateVideo:(NSDate *)dateVideo
-{
- [self checkAssetsLibraryWithDatePhoto:datePhoto dateVideo:dateVideo];
-
- return self.assetsNewToUpload;
-}
-
-- (void)checkAssetsLibraryWithDatePhoto:(NSDate *)datePhoto dateVideo:(NSDate *)dateVideo
-{
- self.assetsNewToUpload = [[NSMutableArray alloc] init];
- ALAssetsLibrary *assetLibrary = [CCUtility defaultAssetsLibrary];
- tableAccount *tableAccount = [[NCManageDatabase sharedInstance] getAccountActive];
-
- if (tableAccount.autoUpload) {
-
- dispatch_semaphore_t semaphoreGroup = dispatch_semaphore_create(0);
-
- [assetLibrary enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos usingBlock:^(ALAssetsGroup *group, BOOL *stop) {
-
- if (group == nil) {
- dispatch_semaphore_signal(semaphoreGroup);
- return;
- }
-
- NSUInteger nType = [[group valueForProperty:ALAssetsGroupPropertyType] intValue];
-
- if (nType == ALAssetsGroupSavedPhotos){
- [self.assetGroups addObject:group];
- self.assetsNewToUpload = [self getArrayNewAssetsFromGroup:group datePhoto:datePhoto dateVideo:dateVideo];
- }
-
- } failureBlock:^(NSError *error) {
-
- 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];
-
- NSLog(@"[LOG] checkAssetsLibrary : Access error at camera roll %@", [error description]);
-
- dispatch_semaphore_signal(semaphoreGroup);
- }];
-
- while (dispatch_semaphore_wait(semaphoreGroup, DISPATCH_TIME_NOW))
- [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
- }
-}
-
-- (NSMutableArray *)getArrayNewAssetsFromGroup:(ALAssetsGroup *)group datePhoto:(NSDate *)datePhoto dateVideo:(NSDate *)dateVideo
-{
- tableAccount *tableAccount = [[NCManageDatabase sharedInstance] getAccountActive];
- if (!tableAccount.autoUpload)
- return nil;
-
- NSMutableArray *tmpAssetsNew = [[NSMutableArray alloc] init];
-
- // Photo
-
- if (tableAccount.autoUploadPhoto) {
-
- dispatch_semaphore_t semaphoreAsset = dispatch_semaphore_create(0);
-
- [group enumerateAssetsWithOptions:NSEnumerationReverse usingBlock:^(ALAsset *result, NSUInteger index, BOOL *stop) {
-
- NSDate *assetDate = [result valueForProperty:ALAssetPropertyDate];
- NSString *assetType = [result valueForProperty:ALAssetPropertyType];
-
- if ([assetDate compare:datePhoto] == NSOrderedDescending) {
-
- if ([assetType isEqualToString:@"ALAssetTypePhoto"]) {
-
- NSLog(@"[LOG] Insert new asset %@ - %@", assetDate, assetType);
-
- [tmpAssetsNew insertObject:result atIndex:0];
- }
-
- } else {
-
- dispatch_semaphore_signal(semaphoreAsset);
- *stop = YES;
- }
- }];
-
- while (dispatch_semaphore_wait(semaphoreAsset, DISPATCH_TIME_NOW))
- [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
- }
-
- // Video
-
- if (tableAccount.autoUploadVideo) {
-
- dispatch_semaphore_t semaphoreAsset = dispatch_semaphore_create(0);
-
- [group enumerateAssetsWithOptions:NSEnumerationReverse usingBlock:^(ALAsset *result, NSUInteger index, BOOL *stop) {
-
- NSDate *assetDate = [result valueForProperty:ALAssetPropertyDate];
- NSString *assetType = [result valueForProperty:ALAssetPropertyType];
-
- if ([assetDate compare:dateVideo] == NSOrderedDescending) {
-
- if ([assetType isEqualToString:@"ALAssetTypeVideo"]) {
-
- NSLog(@"[LOG] Insert new asset %@ - %@", assetDate, assetType);
-
- [tmpAssetsNew insertObject:result atIndex:0];
- }
-
- } else {
-
- dispatch_semaphore_signal(semaphoreAsset);
- *stop = YES;
- }
- }];
-
- while (dispatch_semaphore_wait(semaphoreAsset, DISPATCH_TIME_NOW))
- [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
- }
-
- //NSSortDescriptor *sort = [NSSortDescriptor sortDescriptorWithKey:@"date" ascending:YES];
-
- return tmpAssetsNew; //[tmpAssetsNew sortedArrayUsingDescriptors:@[sort]];
-}
-
-- (void)removePhotoCameraRoll:(NSURL *)assetUrl
-{
- NSArray *urls = [[NSArray alloc] initWithObjects:assetUrl, nil];
-
- PHPhotoLibrary *library = [PHPhotoLibrary sharedPhotoLibrary];
-
- [library performChanges:^{
-
- PHFetchResult *assetsToBeDeleted = [PHAsset fetchAssetsWithALAssetURLs:urls options:nil];
- [PHAssetChangeRequest deleteAssets:assetsToBeDeleted];
-
- } completionHandler:^(BOOL success, NSError *error) {
-
- //do something here
- }];
-}
-
-@end