|
@@ -29,6 +29,8 @@ struct FilesDataEntry: TimelineEntry {
|
|
|
let date: Date
|
|
|
let datas: [FilesData]
|
|
|
let isPlaceholder: Bool
|
|
|
+ let userId: String
|
|
|
+ let url: String
|
|
|
let tile: String
|
|
|
let footerImage: String
|
|
|
let footerText: String
|
|
@@ -88,7 +90,7 @@ func getFilesDataEntry(configuration: AccountIntent?, isPreview: Bool, displaySi
|
|
|
var account: tableAccount?
|
|
|
|
|
|
if isPreview {
|
|
|
- return completion(FilesDataEntry(date: Date(), datas: datasPlaceholder, isPlaceholder: true, tile: getTitleFilesWidget(account: nil), footerImage: "checkmark.icloud", footerText: NCBrandOptions.shared.brand + " files"))
|
|
|
+ return completion(FilesDataEntry(date: Date(), datas: datasPlaceholder, isPlaceholder: true, userId: "", url: "", tile: getTitleFilesWidget(account: nil), footerImage: "checkmark.icloud", footerText: NCBrandOptions.shared.brand + " files"))
|
|
|
}
|
|
|
|
|
|
let accountIdentifier: String = configuration?.accounts?.identifier ?? "active"
|
|
@@ -99,7 +101,7 @@ func getFilesDataEntry(configuration: AccountIntent?, isPreview: Bool, displaySi
|
|
|
}
|
|
|
|
|
|
guard let account = account else {
|
|
|
- return completion(FilesDataEntry(date: Date(), datas: datasPlaceholder, isPlaceholder: true, tile: getTitleFilesWidget(account: nil), footerImage: "xmark.icloud", footerText: NSLocalizedString("_no_active_account_", value: "No account found", comment: "")))
|
|
|
+ return completion(FilesDataEntry(date: Date(), datas: datasPlaceholder, isPlaceholder: true, userId: "", url: "", tile: getTitleFilesWidget(account: nil), footerImage: "xmark.icloud", footerText: NSLocalizedString("_no_active_account_", value: "No account found", comment: "")))
|
|
|
}
|
|
|
|
|
|
@Sendable func isLive(file: NKFile, files: [NKFile]) -> Bool {
|
|
@@ -254,16 +256,16 @@ func getFilesDataEntry(configuration: AccountIntent?, isPreview: Bool, displaySi
|
|
|
let footerText = "Files " + NSLocalizedString("_of_", comment: "") + " " + account.displayName + alias
|
|
|
|
|
|
if error != .success {
|
|
|
- completion(FilesDataEntry(date: Date(), datas: datasPlaceholder, isPlaceholder: true, tile: title, footerImage: "xmark.icloud", footerText: error.errorDescription))
|
|
|
+ completion(FilesDataEntry(date: Date(), datas: datasPlaceholder, isPlaceholder: true, userId: account.userId, url: account.urlBase, tile: title, footerImage: "xmark.icloud", footerText: error.errorDescription))
|
|
|
} else if datas.isEmpty {
|
|
|
var footerText = NSLocalizedString("_no_data_available_", comment: "")
|
|
|
let serverVersionMajor = NCManageDatabase.shared.getCapabilitiesServerInt(account: account.account, elements: NCElementsJSON.shared.capabilitiesVersionMajor)
|
|
|
if serverVersionMajor < NCGlobal.shared.nextcloudVersion25 {
|
|
|
footerText = NSLocalizedString("_widget_available_nc25_", comment: "")
|
|
|
}
|
|
|
- completion(FilesDataEntry(date: Date(), datas: datasPlaceholder, isPlaceholder: true, tile: title, footerImage: "checkmark.icloud", footerText: footerText))
|
|
|
+ completion(FilesDataEntry(date: Date(), datas: datasPlaceholder, isPlaceholder: true, userId: account.userId, url: account.urlBase, tile: title, footerImage: "checkmark.icloud", footerText: footerText))
|
|
|
} else {
|
|
|
- completion(FilesDataEntry(date: Date(), datas: datas, isPlaceholder: false, tile: title, footerImage: "checkmark.icloud", footerText: footerText))
|
|
|
+ completion(FilesDataEntry(date: Date(), datas: datas, isPlaceholder: false, userId: account.userId, url: account.urlBase, tile: title, footerImage: "checkmark.icloud", footerText: footerText))
|
|
|
}
|
|
|
}
|
|
|
}
|