-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathNKTrash+Extensions.swift
More file actions
45 lines (43 loc) · 1.83 KB
/
NKTrash+Extensions.swift
File metadata and controls
45 lines (43 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
// SPDX-License-Identifier: LGPL-3.0-or-later
import Foundation
import NextcloudKit
extension NKTrash {
///
/// Convert a trashed item representation into sendable item metadata.
///
func toItemMetadata(account: Account, wasTrashedLocally: Bool = false) -> SendableItemMetadata {
SendableItemMetadata(
ocId: ocId,
account: account.ncKitAccount,
classFile: classFile,
contentType: contentType,
creationDate: Date(), // Default as not set in original code
date: date,
directory: directory,
e2eEncrypted: false, // Default as not set in original code
etag: "", // Placeholder as not set in original code
fileId: fileId,
fileName: fileName,
fileNameView: trashbinFileName,
hasPreview: hasPreview,
iconName: iconName,
mountType: "", // Placeholder as not set in original code
ownerId: "", // Placeholder as not set in original code
ownerDisplayName: "", // Placeholder as not set in original code
path: "", // Placeholder as not set in original code
serverUrl: account.trashUrl,
sharePermissionsCollaborationServices: 0, // Default as not set in original code
sharePermissionsCloudMesh: [], // Default as not set in original code
size: size,
uploaded: true,
trashbinFileName: trashbinFileName,
trashbinOriginalLocation: trashbinOriginalLocation,
trashbinDeletionTime: trashbinDeletionTime,
urlBase: account.serverUrl,
user: account.username,
userId: account.id,
wasTrashedLocally: wasTrashedLocally
)
}
}