瀏覽代碼

coding

Signed-off-by: marinofaggiana <marino.faggiana@nextcloud.com>
marinofaggiana 2 年之前
父節點
當前提交
2244916dcb
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      Widget/Nextcloud/NextcloudData.swift

+ 2 - 2
Widget/Nextcloud/NextcloudData.swift

@@ -210,7 +210,7 @@ func getDataEntry(isPreview: Bool, displaySize: CGSize, completion: @escaping (_
                 let urlString = "nextcloud://open-file?path=\(path)&user=\(user)&link=\(link)"
                 guard let url = URL(string: urlString) else { continue }
                 // Recent Data
-                let image:UIImage = NCUtilityGUI.shared.createFilePreviewImage(metadata: metadata, size: imageSize * 3, createPreview: false) ?? UIImage(named: "file")!
+                let image:UIImage = NCUtilityGUI.shared.createFilePreviewImage(metadata: metadata, size: imageSize * 3, createPreview: true) ?? UIImage(named: "file")!
                 let recentData = RecentData.init(id: metadata.ocId, image: image, title: metadata.fileName, subTitle: subTitle, url: url)
                 recentDatas.append(recentData)
                 if recentDatas.count == 5 { break}
@@ -221,7 +221,7 @@ func getDataEntry(isPreview: Bool, displaySize: CGSize, completion: @escaping (_
             let metadatas = NCManageDatabase.shared.getAdvancedMetadatas(predicate: NSPredicate(format: "status == %i || status == %i || status == %i", NCGlobal.shared.metadataStatusWaitUpload, NCGlobal.shared.metadataStatusInUpload, NCGlobal.shared.metadataStatusUploading), page: 1, limit: limitUpload, sorted: "sessionTaskIdentifier", ascending: false)
             for metadata in metadatas {
                 // image
-                let image = UIImage(named: "file")!
+                let image:UIImage = NCUtilityGUI.shared.createFilePreviewImage(metadata: metadata, size: imageSize * 3, createPreview: true) ?? UIImage(named: "file")!
                 // Upload Data
                 uploadDatas.append(UploadData(id: metadata.ocId, image: image, task: metadata.sessionTaskIdentifier, num: 0))
             }