|
@@ -1523,13 +1523,19 @@
|
|
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
|
|
|
|
|
|
metadata = [CCUtility insertInformationPlist:metadata directoryUser:app.directoryUser];
|
|
|
- metadata = [[NCManageDatabase sharedInstance] updateMetadata:metadata activeUrl:app.activeUrl];
|
|
|
|
|
|
- // se è un template aggiorniamo anche nel FileSystem
|
|
|
- if ([metadata.type isEqualToString: k_metadataType_template]) {
|
|
|
- [[NCManageDatabase sharedInstance] setLocalFileWithFileID:metadata.fileID date:metadata.date exifDate:nil exifLatitude:nil exifLongitude:nil fileName:nil fileNamePrint:metadata.fileNamePrint];
|
|
|
+ if (metadata) {
|
|
|
+
|
|
|
+ metadata = [[NCManageDatabase sharedInstance] updateMetadata:metadata activeUrl:app.activeUrl];
|
|
|
+
|
|
|
+ // se è un template aggiorniamo anche nel FileSystem
|
|
|
+ if ([metadata.type isEqualToString: k_metadataType_template]) {
|
|
|
+ [[NCManageDatabase sharedInstance] setLocalFileWithFileID:metadata.fileID date:metadata.date exifDate:nil exifLatitude:nil exifLongitude:nil fileName:nil fileNamePrint:metadata.fileNamePrint];
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ NSLog(@"x");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
long countSelectorLoadPlist = 0;
|
|
|
|
|
|
for (NSOperation *operation in [app.netQueue operations]) {
|
|
@@ -1537,13 +1543,14 @@
|
|
|
if ([((OCnetworking *)operation).metadataNet.selector isEqualToString:selectorLoadPlist])
|
|
|
countSelectorLoadPlist++;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if ((countSelectorLoadPlist == 0 || countSelectorLoadPlist % k_maxConcurrentOperation == 0) && [metadata.directoryID isEqualToString:[[NCManageDatabase sharedInstance] getDirectoryID:_serverUrl]]) {
|
|
|
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
[self reloadDatasource:serverUrl fileID:metadata.fileID selector:selector];
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
});
|
|
|
}
|
|
|
|