Skip to content

Commit 49338cd

Browse files
committed
Add method to retrieve all materialised items from database
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
1 parent 1250097 commit 49338cd

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

Sources/NextcloudFileProviderKit/Database/FilesDatabaseManager.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,4 +601,13 @@ public final class FilesDatabaseManager: Sendable {
601601
}
602602
return NSFileProviderItemIdentifier(parentMetadata.ocId)
603603
}
604+
605+
public func materialisedItemMetadatas(account: String) -> [SendableItemMetadata] {
606+
itemMetadatas
607+
.where {
608+
$0.account == account &&
609+
(($0.directory && $0.visitedDirectory) || (!$0.directory && $0.downloaded))
610+
}
611+
.toUnmanagedResults()
612+
}
604613
}

0 commit comments

Comments
 (0)