Skip to content

Commit

Permalink
https://github.com/nextcloud/ios/issues/2971
Browse files Browse the repository at this point in the history
Signed-off-by: Marino Faggiana <[email protected]>
  • Loading branch information
marinofaggiana committed Jul 3, 2024
1 parent dad0c09 commit 84f9efa
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
5 changes: 1 addition & 4 deletions iOSClient/Networking/NCNetworking+AsyncAwait.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,10 @@ extension NCNetworking {
heightPreview: Int = 512,
sizeIcon: Int = 512,
etag: String? = nil,
crop: Int = 0,
cropMode: String = "fill",
forceIcon: Int = 1,
mimeFallback: Int = 0,
options: NKRequestOptions = NKRequestOptions()) async -> (account: String, imagePreview: UIImage?, imageIcon: UIImage?, imageOriginal: UIImage?, etag: String?, error: NKError) {
await withUnsafeContinuation({ continuation in
NextcloudKit.shared.downloadPreview(fileId: fileId, fileNamePreviewLocalPath: fileNamePreviewLocalPath, fileNameIconLocalPath: fileNameIconLocalPath, widthPreview: widthPreview, heightPreview: heightPreview, sizeIcon: sizeIcon, etag: etag, crop: crop, cropMode: cropMode, forceIcon: forceIcon, mimeFallback: mimeFallback, options: options) { account, imagePreview, imageIcon, imageOriginal, etag, error in
NextcloudKit.shared.downloadPreview(fileId: fileId, fileNamePreviewLocalPath: fileNamePreviewLocalPath, fileNameIconLocalPath: fileNameIconLocalPath, widthPreview: widthPreview, heightPreview: heightPreview, sizeIcon: sizeIcon, etag: etag, mimeFallback: mimeFallback, options: options) { account, imagePreview, imageIcon, imageOriginal, etag, error in
continuation.resume(returning: (account: account, imagePreview: imagePreview, imageIcon: imageIcon, imageOriginal: imageOriginal, etag: etag, error: error))
}
})
Expand Down
1 change: 0 additions & 1 deletion iOSClient/Viewer/NCViewerMedia/NCViewerMedia.swift
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ class NCViewerMedia: UIViewController {
heightPreview: Int(sizePreview.height),
sizeIcon: NCGlobal.shared.sizeIcon,
options: NKRequestOptions(queue: .main)) { _, imagePreview, _, _, etag, error in

if error == .success, let image = imagePreview {
NCManageDatabase.shared.setMetadataEtagResource(ocId: self.metadata.ocId, etagResource: etag)
return completion(image)
Expand Down

0 comments on commit 84f9efa

Please sign in to comment.