|
@@ -707,9 +707,8 @@
|
|
|
[coordinator coordinateReadingItemAtURL:url options:NSFileCoordinatorReadingForUploading error:&error byAccessor:^(NSURL *newURL) {
|
|
|
|
|
|
NSString *serverUrl = [appDelegate getTabBarControllerActiveServerUrl];
|
|
|
- NSString *directoryID = [[NCManageDatabase sharedInstance] getDirectoryID:serverUrl account:appDelegate.activeAccount];
|
|
|
NSString *fileName = [[NCUtility sharedInstance] createFileName:[url lastPathComponent] serverUrl:serverUrl account:appDelegate.activeAccount];
|
|
|
- NSString *fileID = [directoryID stringByAppendingString:fileName];
|
|
|
+ NSString *fileID = [CCUtility createMetadataIDFromAccount:appDelegate.activeAccount serverUrl:serverUrl fileName:fileName directory:false];
|
|
|
NSData *data = [NSData dataWithContentsOfURL:newURL];
|
|
|
|
|
|
if (data && error == nil) {
|
|
@@ -1067,7 +1066,7 @@
|
|
|
metadataForUpload.account = appDelegate.activeAccount;
|
|
|
metadataForUpload.assetLocalIdentifier = asset.localIdentifier;
|
|
|
metadataForUpload.date = [NSDate new];
|
|
|
- metadataForUpload.fileID = [[[NCManageDatabase sharedInstance] getDirectoryID:serverUrl account:appDelegate.activeAccount] stringByAppendingString:fileName];
|
|
|
+ metadataForUpload.fileID = [CCUtility createMetadataIDFromAccount:appDelegate.activeAccount serverUrl:serverUrl fileName:fileName directory:false];
|
|
|
metadataForUpload.fileName = fileName;
|
|
|
metadataForUpload.fileNameView = fileName;
|
|
|
metadataForUpload.serverUrl = serverUrl;
|
|
@@ -1320,9 +1319,7 @@
|
|
|
|
|
|
_loadingFolder = YES;
|
|
|
[self tableViewReloadData];
|
|
|
-
|
|
|
- tableDirectory *directory = [[NCManageDatabase sharedInstance] getTableDirectoryWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@", appDelegate.activeAccount, serverUrl]];
|
|
|
-
|
|
|
+
|
|
|
CCMetadataNet *metadataNet = [[CCMetadataNet alloc] initWithAccount:appDelegate.activeAccount];
|
|
|
|
|
|
metadataNet.action = actionReadFolder;
|
|
@@ -1863,8 +1860,6 @@
|
|
|
{
|
|
|
fileNameFolder = [CCUtility removeForbiddenCharactersServer:fileNameFolder];
|
|
|
if (![fileNameFolder length]) return;
|
|
|
- NSString *directoryID = [[NCManageDatabase sharedInstance] getDirectoryID:serverUrl account:appDelegate.activeAccount];
|
|
|
- if (!directoryID) return;
|
|
|
NSString *fileIDTemp = [[NSUUID UUID] UUIDString];
|
|
|
|
|
|
// Create Directory (temp) on metadata
|
|
@@ -3047,7 +3042,6 @@
|
|
|
|
|
|
NSData *dataFileID = [dic objectForKey: k_metadataKeyedUnarchiver];
|
|
|
NSString *fileID = [NSKeyedUnarchiver unarchiveObjectWithData:dataFileID];
|
|
|
- NSString *directoryID = [[NCManageDatabase sharedInstance] getDirectoryID:self.serverUrl account:appDelegate.activeAccount];
|
|
|
|
|
|
tableMetadata *metadata = [[NCManageDatabase sharedInstance] getMetadataWithPredicate:[NSPredicate predicateWithFormat:@"fileID == %@", fileID]];
|
|
|
|
|
@@ -3056,15 +3050,14 @@
|
|
|
if ([CCUtility fileProviderStorageExists:metadata.fileID fileNameView:metadata.fileNameView]) {
|
|
|
|
|
|
NSString *fileName = [[NCUtility sharedInstance] createFileName:metadata.fileNameView serverUrl:self.serverUrl account:appDelegate.activeAccount];
|
|
|
- NSString *fileID = [directoryID stringByAppendingString:fileName];
|
|
|
-
|
|
|
+
|
|
|
[CCUtility copyFileAtPath:[CCUtility getDirectoryProviderStorageFileID:metadata.fileID fileNameView:metadata.fileNameView] toPath:[CCUtility getDirectoryProviderStorageFileID:fileID fileNameView:fileName]];
|
|
|
|
|
|
tableMetadata *metadataForUpload = [tableMetadata new];
|
|
|
|
|
|
metadataForUpload.account = appDelegate.activeAccount;
|
|
|
metadataForUpload.date = [NSDate new];
|
|
|
- metadataForUpload.fileID = fileID;
|
|
|
+ metadataForUpload.fileID = [CCUtility createMetadataIDFromAccount:appDelegate.activeAccount serverUrl:self.serverUrl fileName:fileName directory:false];
|
|
|
metadataForUpload.fileName = fileName;
|
|
|
metadataForUpload.fileNameView = fileName;
|
|
|
metadataForUpload.serverUrl = self.serverUrl;
|