|
@@ -1004,10 +1004,6 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
|
|
|
@objc func reloadDataSource(forced: Bool = true) {
|
|
|
guard !appDelegate.account.isEmpty else { return }
|
|
|
|
|
|
- // Get richWorkspace Text
|
|
|
- let directory = NCManageDatabase.shared.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", appDelegate.account, serverUrl))
|
|
|
- richWorkspaceText = directory?.richWorkspace
|
|
|
-
|
|
|
// E2EE
|
|
|
isEncryptedFolder = CCUtility.isFolderEncrypted(serverUrl, e2eEncrypted: metadataFolder?.e2eEncrypted ?? false, account: appDelegate.account, urlBase: appDelegate.urlBase)
|
|
|
|
|
@@ -1016,7 +1012,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
|
|
|
autoUploadDirectory = NCManageDatabase.shared.getAccountAutoUploadDirectory(urlBase: appDelegate.urlBase, account: appDelegate.account)
|
|
|
|
|
|
// get layout for view
|
|
|
- //layoutForView = NCUtility.shared.getLayoutForView(key: layoutKey, serverUrl: serverUrl)
|
|
|
+ layoutForView = NCUtility.shared.getLayoutForView(key: layoutKey, serverUrl: serverUrl)
|
|
|
|
|
|
// set GroupField for Grid
|
|
|
if !self.isSearching && layoutForView?.layout == NCGlobal.shared.layoutGrid {
|
|
@@ -1449,39 +1445,20 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
|
|
|
(cell as! NCCellProtocol).filePreviewImageView?.image = NCBrandColor.cacheImages.file
|
|
|
}
|
|
|
|
|
|
- //var urlString: String = ""
|
|
|
if !metadata.iconUrl.isEmpty {
|
|
|
if let ownerId = NCUtility.shared.getAvatarFromIconUrl(metadata: metadata), let cell = cell as? NCCellProtocol {
|
|
|
let fileName = metadata.userBaseUrl + "-" + ownerId + ".png"
|
|
|
NCOperationQueue.shared.downloadAvatar(user: ownerId, dispalyName: nil, fileName: fileName, cell: cell, view: collectionView, cellImageView: cell.filePreviewImageView)
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- /*
|
|
|
- if metadata.iconUrl.starts(with: "/apps") {
|
|
|
- //urlString = metadata.urlBase + metadata.iconUrl
|
|
|
- } else if metadata.iconUrl.contains("http") && metadata.iconUrl.contains("avatar") {
|
|
|
- let splitIconUrl = metadata.iconUrl.components(separatedBy: "/")
|
|
|
- var found:Bool = false
|
|
|
- var ownerId: String = ""
|
|
|
- for item in splitIconUrl {
|
|
|
- if found {
|
|
|
- ownerId = item
|
|
|
- break
|
|
|
- }
|
|
|
- if item == "avatar" { found = true}
|
|
|
- }
|
|
|
- let fileName = metadata.userBaseUrl + "-" + ownerId + ".png"
|
|
|
- if let cell = cell as? NCCellProtocol {
|
|
|
- NCOperationQueue.shared.downloadAvatar(user: ownerId, dispalyName: nil, fileName: fileName, cell: cell, view: collectionView, cellImageView: cell.filePreviewImageView)
|
|
|
- }
|
|
|
- }
|
|
|
-// NCCommunication.shared.downloadContent(serverUrl: urlString) { _, data, errorCode, _ in
|
|
|
-// if errorCode == 0, let data = data, let image = UIImage(data: data) {
|
|
|
-// (cell as! NCCellProtocol).filePreviewImageView?.image = image
|
|
|
-// }
|
|
|
+// if metadata.iconName.contains("contacts"), let subline = metadata.subline, !subline.isEmpty, let cell = cell as? NCCellProtocol {
|
|
|
+// let components = subline.components(separatedBy: "@")
|
|
|
+// if let user = components.first {
|
|
|
+// let fileName = metadata.userBaseUrl + "-" + user + ".png"
|
|
|
+// NCOperationQueue.shared.downloadAvatar(user: user, dispalyName: nil, fileName: fileName, cell: cell, view: collectionView, cellImageView: cell.filePreviewImageView)
|
|
|
// }
|
|
|
- */
|
|
|
- }
|
|
|
+// }
|
|
|
}
|
|
|
}
|
|
|
|