Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
Signed-off-by: Marino Faggiana <[email protected]>
  • Loading branch information
marinofaggiana committed Oct 19, 2023
1 parent a6c9c20 commit 1023a19
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 43 deletions.
17 changes: 8 additions & 9 deletions iOSClient/Main/Collection Common/NCCollectionViewCommon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1733,15 +1733,14 @@ class NCCollectionViewDownloadThumbnail: ConcurrentOperation {
etagResource = metadata.etagResource
}

NextcloudKit.shared.downloadPreview(
fileNamePathOrFileId: fileNamePath,
fileNamePreviewLocalPath: fileNamePreviewLocalPath,
widthPreview: NCGlobal.shared.sizePreview,
heightPreview: NCGlobal.shared.sizePreview,
fileNameIconLocalPath: fileNameIconLocalPath,
sizeIcon: NCGlobal.shared.sizeIcon,
etag: etagResource,
options: NKRequestOptions(queue: NextcloudKit.shared.nkCommonInstance.backgroundQueue)) { _, _, imageIcon, _, etag, error in
NextcloudKit.shared.downloadPreview(fileNamePathOrFileId: fileNamePath,
fileNamePreviewLocalPath: fileNamePreviewLocalPath,
widthPreview: NCGlobal.shared.sizePreview,
heightPreview: NCGlobal.shared.sizePreview,
fileNameIconLocalPath: fileNameIconLocalPath,
sizeIcon: NCGlobal.shared.sizeIcon,
etag: etagResource,
options: NKRequestOptions(queue: NextcloudKit.shared.nkCommonInstance.backgroundQueue)) { _, _, imageIcon, _, etag, error in

if error == .success, let image = imageIcon {
NCManageDatabase.shared.setMetadataEtagResource(ocId: self.metadata.ocId, etagResource: etag)
Expand Down
17 changes: 8 additions & 9 deletions iOSClient/Media/NCMedia.swift
Original file line number Diff line number Diff line change
Expand Up @@ -884,15 +884,14 @@ class NCMediaDownloadThumbnaill: ConcurrentOperation {
etagResource = metadata.etagResource
}

NextcloudKit.shared.downloadPreview(
fileNamePathOrFileId: fileNamePath,
fileNamePreviewLocalPath: fileNamePreviewLocalPath,
widthPreview: NCGlobal.shared.sizePreview,
heightPreview: NCGlobal.shared.sizePreview,
fileNameIconLocalPath: fileNameIconLocalPath,
sizeIcon: NCGlobal.shared.sizeIcon,
etag: etagResource,
options: NKRequestOptions(queue: NextcloudKit.shared.nkCommonInstance.backgroundQueue)) { _, imagePreview, _, _, etag, error in
NextcloudKit.shared.downloadPreview(fileNamePathOrFileId: fileNamePath,
fileNamePreviewLocalPath: fileNamePreviewLocalPath,
widthPreview: NCGlobal.shared.sizePreview,
heightPreview: NCGlobal.shared.sizePreview,
fileNameIconLocalPath: fileNameIconLocalPath,
sizeIcon: NCGlobal.shared.sizeIcon,
etag: etagResource,
options: NKRequestOptions(queue: NextcloudKit.shared.nkCommonInstance.backgroundQueue)) { _, imagePreview, _, _, etag, error in

if error == .success, let image = imagePreview {
NCManageDatabase.shared.setMetadataEtagResource(ocId: self.metadata.ocId, etagResource: etag)
Expand Down
15 changes: 7 additions & 8 deletions iOSClient/Networking/NCOperationQueue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,13 @@ class NCOperationDownloadThumbnailActivity: ConcurrentOperation {

guard !isCancelled else { return self.finish() }

NextcloudKit.shared.downloadPreview(
fileNamePathOrFileId: fileNamePathOrFileId,
fileNamePreviewLocalPath: fileNamePreviewLocalPath,
widthPreview: 0,
heightPreview: 0,
etag: nil,
useInternalEndpoint: false,
options: NKRequestOptions(queue: NextcloudKit.shared.nkCommonInstance.backgroundQueue)) { _, imagePreview, _, _, _, error in
NextcloudKit.shared.downloadPreview(fileNamePathOrFileId: fileNamePathOrFileId,
fileNamePreviewLocalPath: fileNamePreviewLocalPath,
widthPreview: 0,
heightPreview: 0,
etag: nil,
useInternalEndpoint: false,
options: NKRequestOptions(queue: NextcloudKit.shared.nkCommonInstance.backgroundQueue)) { _, imagePreview, _, _, _, error in

if error == .success, let imagePreview = imagePreview {
DispatchQueue.main.async {
Expand Down
33 changes: 16 additions & 17 deletions iOSClient/Trash/NCTrash.swift
Original file line number Diff line number Diff line change
Expand Up @@ -350,22 +350,21 @@ extension NCTrash {
let fileNamePreviewLocalPath = CCUtility.getDirectoryProviderStoragePreviewOcId(tableTrash.fileId, etag: tableTrash.fileName)!
let fileNameIconLocalPath = CCUtility.getDirectoryProviderStorageIconOcId(tableTrash.fileId, etag: tableTrash.fileName)!

NextcloudKit.shared.downloadPreview(
fileNamePathOrFileId: tableTrash.fileId,
fileNamePreviewLocalPath: fileNamePreviewLocalPath,
widthPreview: NCGlobal.shared.sizePreview,
heightPreview: NCGlobal.shared.sizePreview,
fileNameIconLocalPath: fileNameIconLocalPath,
sizeIcon: NCGlobal.shared.sizeIcon,
etag: nil,
endpointTrashbin: true) { account, _, imageIcon, _, _, error in
guard error == .success, let imageIcon = imageIcon, account == self.appDelegate.account,
let cell = self.collectionView.cellForItem(at: indexPath) else { return }
if let cell = cell as? NCTrashListCell {
cell.imageItem.image = imageIcon
} else if let cell = cell as? NCGridCell {
cell.imageItem.image = imageIcon
} // else: undefined cell
}
NextcloudKit.shared.downloadPreview(fileNamePathOrFileId: tableTrash.fileId,
fileNamePreviewLocalPath: fileNamePreviewLocalPath,
widthPreview: NCGlobal.shared.sizePreview,
heightPreview: NCGlobal.shared.sizePreview,
fileNameIconLocalPath: fileNameIconLocalPath,
sizeIcon: NCGlobal.shared.sizeIcon,
etag: nil,
endpointTrashbin: true) { account, _, imageIcon, _, _, error in
guard error == .success, let imageIcon = imageIcon, account == self.appDelegate.account,
let cell = self.collectionView.cellForItem(at: indexPath) else { return }
if let cell = cell as? NCTrashListCell {
cell.imageItem.image = imageIcon
} else if let cell = cell as? NCGridCell {
cell.imageItem.image = imageIcon
} // else: undefined cell
}
}
}

0 comments on commit 1023a19

Please sign in to comment.