Skip to content

Commit 1250097

Browse files
committed
Add materialisation-relevant property to item metadatas for folders
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
1 parent 71d48fa commit 1250097

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

Sources/NextcloudFileProviderKit/Metadata/ItemMetadata.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ public protocol ItemMetadata: Equatable {
9393
var downloaded: Bool { get set }
9494
var uploaded: Bool { get set }
9595
var keepDownloaded: Bool { get set }
96+
var visitedDirectory: Bool { get set }
9697
var trashbinFileName: String { get set }
9798
var trashbinOriginalLocation: String { get set }
9899
var trashbinDeletionTime: Date { get set }

Sources/NextcloudFileProviderKit/Metadata/RealmItemMetadata.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ internal class RealmItemMetadata: Object, ItemMetadata {
8585
@Persisted public var downloaded = false
8686
@Persisted public var uploaded = false
8787
@Persisted public var keepDownloaded = false
88+
@Persisted public var visitedDirectory = false
8889
@Persisted public var trashbinFileName = ""
8990
@Persisted public var trashbinOriginalLocation = ""
9091
@Persisted public var trashbinDeletionTime = Date()

Sources/NextcloudFileProviderKit/Metadata/SendableItemMetadata.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public struct SendableItemMetadata: ItemMetadata, Sendable {
6464
public var downloaded: Bool
6565
public var uploaded: Bool
6666
public var keepDownloaded: Bool
67+
public var visitedDirectory: Bool
6768
public var trashbinFileName: String
6869
public var trashbinOriginalLocation: String
6970
public var trashbinDeletionTime: Date
@@ -91,12 +92,12 @@ public struct SendableItemMetadata: ItemMetadata, Sendable {
9192
fileId: String,
9293
fileName: String,
9394
fileNameView: String,
94-
hasPreview: Bool,
95+
hasPreview: Bool = false,
9596
hidden: Bool = false,
96-
iconName: String,
97+
iconName: String = "",
9798
iconUrl: String = "",
9899
livePhotoFile: String? = nil,
99-
mountType: String,
100+
mountType: String = "",
100101
name: String = "",
101102
note: String = "",
102103
ownerId: String,
@@ -127,6 +128,7 @@ public struct SendableItemMetadata: ItemMetadata, Sendable {
127128
downloaded: Bool = false,
128129
uploaded: Bool = false,
129130
keepDownloaded: Bool = false,
131+
visitedDirectory: Bool = false,
130132
trashbinFileName: String = "",
131133
trashbinOriginalLocation: String = "",
132134
trashbinDeletionTime: Date = Date(),
@@ -189,6 +191,7 @@ public struct SendableItemMetadata: ItemMetadata, Sendable {
189191
self.downloaded = downloaded
190192
self.uploaded = uploaded
191193
self.keepDownloaded = keepDownloaded
194+
self.visitedDirectory = visitedDirectory
192195
self.trashbinFileName = trashbinFileName
193196
self.trashbinOriginalLocation = trashbinOriginalLocation
194197
self.trashbinDeletionTime = trashbinDeletionTime
@@ -252,6 +255,7 @@ public struct SendableItemMetadata: ItemMetadata, Sendable {
252255
self.downloaded = value.downloaded
253256
self.uploaded = value.uploaded
254257
self.keepDownloaded = value.keepDownloaded
258+
self.visitedDirectory = value.visitedDirectory
255259
self.tags = value.tags
256260
self.trashbinFileName = value.trashbinFileName
257261
self.trashbinOriginalLocation = value.trashbinOriginalLocation

0 commit comments

Comments
 (0)