|
@@ -625,9 +625,16 @@ extension NCViewerImage: NCViewerImageZoomDelegate {
|
|
|
let fileNamePath = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, urlBase: metadata.urlBase, account: metadata.account)!
|
|
|
let fileNamePreviewLocalPath = CCUtility.getDirectoryProviderStoragePreviewOcId(metadata.ocId, etag: metadata.etag)!
|
|
|
let fileNameIconLocalPath = CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, etag: metadata.etag)!
|
|
|
+ var etagResource: String?
|
|
|
|
|
|
- NCCommunication.shared.downloadPreview(fileNamePathOrFileId: fileNamePath, fileNamePreviewLocalPath: fileNamePreviewLocalPath, widthPreview: NCGlobal.shared.sizePreview, heightPreview: NCGlobal.shared.sizePreview, fileNameIconLocalPath: fileNameIconLocalPath, sizeIcon: NCGlobal.shared.sizeIcon, etag: nil) { (account, imagePreview, imageIcon, etag, errorCode, errorMessage) in
|
|
|
+ if FileManager.default.fileExists(atPath: fileNameIconLocalPath) && FileManager.default.fileExists(atPath: fileNamePreviewLocalPath) {
|
|
|
+ etagResource = metadata.etagResource
|
|
|
+ }
|
|
|
+
|
|
|
+ NCCommunication.shared.downloadPreview(fileNamePathOrFileId: fileNamePath, fileNamePreviewLocalPath: fileNamePreviewLocalPath, widthPreview: NCGlobal.shared.sizePreview, heightPreview: NCGlobal.shared.sizePreview, fileNameIconLocalPath: fileNameIconLocalPath, sizeIcon: NCGlobal.shared.sizeIcon, etag: etagResource) { (account, imagePreview, imageIcon, etag, errorCode, errorMessage) in
|
|
|
+
|
|
|
if errorCode == 0 && metadata.ocId == self.currentMetadata.ocId {
|
|
|
+ NCManageDatabase.shared.setMetadataEtagResource(ocId: metadata.ocId, etagResource: etag)
|
|
|
self.reloadCurrentPage()
|
|
|
}
|
|
|
}
|