|
@@ -284,9 +284,7 @@ class NCOperationSynchronization: ConcurrentOperation {
|
|
|
if metadata.directory {
|
|
|
NCOperationQueue.shared.synchronizationMetadata(metadata, selector: self.selector)
|
|
|
} else {
|
|
|
- let localFile = NCManageDatabase.shared.getTableLocalFile(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
|
|
|
- let fileSize = CCUtility.fileProviderStorageSize(metadata.ocId, fileNameView: metadata.fileNameView)
|
|
|
- if localFile == nil || localFile?.etag != metadata.etag || fileSize == 0 {
|
|
|
+ if NCManageDatabase.shared.isDownloadMetadata(metadata, download: true) {
|
|
|
NCOperationQueue.shared.download(metadata: metadata, selector: self.selector, setFavorite: false)
|
|
|
}
|
|
|
}
|
|
@@ -325,9 +323,7 @@ class NCOperationSynchronization: ConcurrentOperation {
|
|
|
if metadata.directory {
|
|
|
NCOperationQueue.shared.synchronizationMetadata(metadata, selector: self.selector)
|
|
|
} else {
|
|
|
- let localFile = NCManageDatabase.shared.getTableLocalFile(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
|
|
|
- let fileSize = CCUtility.fileProviderStorageSize(metadata.ocId, fileNameView: metadata.fileNameView)
|
|
|
- if localFile == nil && (localFile?.etag != metadata.etag || fileSize == 0) {
|
|
|
+ if NCManageDatabase.shared.isDownloadMetadata(metadata, download: self.download) {
|
|
|
NCOperationQueue.shared.download(metadata: metadata, selector: self.selector, setFavorite: false)
|
|
|
}
|
|
|
}
|
|
@@ -338,12 +334,8 @@ class NCOperationSynchronization: ConcurrentOperation {
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
- if self.download {
|
|
|
- let localFile = NCManageDatabase.shared.getTableLocalFile(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
|
|
|
- let fileSize = CCUtility.fileProviderStorageSize(metadata.ocId, fileNameView: metadata.fileNameView)
|
|
|
- if localFile == nil || localFile?.etag != metadata.etag || fileSize == 0 {
|
|
|
- NCOperationQueue.shared.download(metadata: metadata, selector: self.selector, setFavorite: false)
|
|
|
- }
|
|
|
+ if NCManageDatabase.shared.isDownloadMetadata(metadata, download: self.download) {
|
|
|
+ NCOperationQueue.shared.download(metadata: metadata, selector: self.selector, setFavorite: false)
|
|
|
}
|
|
|
self.finish()
|
|
|
}
|