Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Sources/NextcloudKit/Models/NKProperties.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,14 @@ public enum NKProperties: String, CaseIterable {
}

static func trashProperties() -> String {
let properties: [String] = [displayname.rawValue, getcontenttype.rawValue, resourcetype.rawValue, id.rawValue, fileid.rawValue, size.rawValue, haspreview.rawValue, "<trashbin-filename xmlns=\"http://nextcloud.org/ns\"/>", "<trashbin-original-location xmlns=\"http://nextcloud.org/ns\"/>", "<trashbin-deletion-time xmlns=\"http://nextcloud.org/ns\"/>"]
return properties.joined()
let base = allCases.map { $0.rawValue }.joined()

let trashExtras = [
"<trashbin-filename xmlns=\"http://nextcloud.org/ns\"/>",
"<trashbin-original-location xmlns=\"http://nextcloud.org/ns\"/>",
"<trashbin-deletion-time xmlns=\"http://nextcloud.org/ns\"/>"
].joined()

return base + trashExtras
}
}
19 changes: 18 additions & 1 deletion Sources/NextcloudKit/Models/NKTrash.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,27 @@ public struct NKTrash: Sendable {
public var iconName: String
public var size: Int64
public var classFile: String
public var livePhoto: Bool
public var trashbinFileName: String
public var trashbinOriginalLocation: String
public var trashbinDeletionTime: Date

public init(ocId: String = "", contentType: String = "", typeIdentifier: String = "", date: Date = Date(), directory: Bool = false, fileId: String = "", fileName: String = "", filePath: String = "", hasPreview: Bool = false, iconName: String = "", size: Int64 = 0, classFile: String = "", trashbinFileName: String = "", trashbinOriginalLocation: String = "", trashbinDeletionTime: Date = Date()) {
public init(ocId: String = "",
contentType: String = "",
typeIdentifier: String = "",
date: Date = Date(),
directory: Bool = false,
fileId: String = "",
fileName: String = "",
filePath: String = "",
hasPreview: Bool = false,
iconName: String = "",
size: Int64 = 0,
classFile: String = "",
livePhoto: Bool = false,
trashbinFileName: String = "",
trashbinOriginalLocation: String = "",
trashbinDeletionTime: Date = Date()) {
self.ocId = ocId
self.contentType = contentType
self.typeIdentifier = typeIdentifier
Expand All @@ -38,6 +54,7 @@ public struct NKTrash: Sendable {
self.iconName = iconName
self.size = size
self.classFile = classFile
self.livePhoto = livePhoto
self.trashbinFileName = trashbinFileName
self.trashbinOriginalLocation = trashbinOriginalLocation
self.trashbinDeletionTime = trashbinDeletionTime
Expand Down
Loading