|
@@ -1343,7 +1343,7 @@
|
|
|
return path;
|
|
|
}
|
|
|
|
|
|
-+ (void)extractImageVideoFromAssetLocalIdentifierForUpload:(tableMetadata *)metadataForUpload notification:(BOOL)notification completion:(void(^)(tableMetadata *metadata, NSString* fileNamePath))completion
|
|
|
++ (void)extractImageVideoFromAssetLocalIdentifierForUpload:(tableMetadata *)metadataForUpload completion:(void(^)(tableMetadata *metadata, NSString* fileNamePath))completion
|
|
|
{
|
|
|
if (metadataForUpload == nil) {
|
|
|
return completion(nil, nil);
|
|
@@ -1353,10 +1353,6 @@
|
|
|
|
|
|
PHFetchResult *result = [PHAsset fetchAssetsWithLocalIdentifiers:@[metadata.assetLocalIdentifier] options:nil];
|
|
|
if (!result.count) {
|
|
|
- if (notification) {
|
|
|
- [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:NCGlobal.shared.notificationCenterUploadedFile object:nil userInfo:@{@"ocId": metadata.ocId, @"errorCode": @(NCGlobal.shared.errorInternalError), @"errorDescription": @"_err_file_not_found_"}];
|
|
|
- }
|
|
|
-
|
|
|
return completion(nil, nil);
|
|
|
}
|
|
|
|
|
@@ -1378,10 +1374,7 @@
|
|
|
NSLog(@"cacheAsset: %f", progress);
|
|
|
|
|
|
if (error) {
|
|
|
- if (notification) {
|
|
|
- [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:NCGlobal.shared.notificationCenterUploadedFile object:nil userInfo:@{@"ocId": metadata.ocId, @"errorCode": @(error.code), @"errorDescription": [NSString stringWithFormat:@"Image request iCloud failed [%@]", error.description]}];
|
|
|
- }
|
|
|
-
|
|
|
+ [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:NCGlobal.shared.notificationCenterUploadedFile object:nil userInfo:@{@"ocId": metadata.ocId, @"errorCode": @(error.code), @"errorDescription": [NSString stringWithFormat:@"Image request iCloud failed [%@]", error.description]}];
|
|
|
return completion(nil, nil);
|
|
|
}
|
|
|
};
|
|
@@ -1443,10 +1436,7 @@
|
|
|
NSLog(@"cacheAsset: %f", progress);
|
|
|
|
|
|
if (error) {
|
|
|
- if (notification) {
|
|
|
- [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:NCGlobal.shared.notificationCenterUploadedFile object:nil userInfo:@{@"ocId": metadata.ocId, @"errorCode": @(error.code), @"errorDescription": [NSString stringWithFormat:@"Video request iCloud failed [%@]", error.description]}];
|
|
|
- }
|
|
|
-
|
|
|
+ [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:NCGlobal.shared.notificationCenterUploadedFile object:nil userInfo:@{@"ocId": metadata.ocId, @"errorCode": @(error.code), @"errorDescription": [NSString stringWithFormat:@"Video request iCloud failed [%@]", error.description]}];
|
|
|
completion(nil, nil);
|
|
|
}
|
|
|
};
|
|
@@ -1467,19 +1457,12 @@
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
|
|
if (error) {
|
|
|
-
|
|
|
- if (notification) {
|
|
|
- [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:NCGlobal.shared.notificationCenterUploadedFile object:nil userInfo:@{@"ocId": metadata.ocId, @"errorCode": @(error.code), @"errorDescription": [NSString stringWithFormat:@"Video request iCloud failed [%@]", error.description]}];
|
|
|
- }
|
|
|
-
|
|
|
+ [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:NCGlobal.shared.notificationCenterUploadedFile object:nil userInfo:@{@"ocId": metadata.ocId, @"errorCode": @(error.code), @"errorDescription": [NSString stringWithFormat:@"Video request iCloud failed [%@]", error.description]}];
|
|
|
completion(nil, nil);
|
|
|
-
|
|
|
} else {
|
|
|
-
|
|
|
metadata.creationDate = creationDate;
|
|
|
metadata.date = modificationDate;
|
|
|
metadata.size = [[NCUtilityFileSystem shared] getFileSizeWithFilePath:fileNamePath];
|
|
|
-
|
|
|
completion(metadata, fileNamePath);
|
|
|
}
|
|
|
});
|