mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-25 22:46:04 +03:00
Add method to get directory tables from database in manager
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
7ff2379e3d
commit
57d585201e
1 changed files with 6 additions and 0 deletions
|
@ -198,6 +198,12 @@ class NextcloudFilesDatabaseManager : NSObject {
|
||||||
return directoryMetadata(account: itemMetadata.account, serverUrl: itemMetadata.serverUrl)
|
return directoryMetadata(account: itemMetadata.account, serverUrl: itemMetadata.serverUrl)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func directoryMetadatas(account: String, parentDirectoryServerUrl: String) -> [NextcloudDirectoryMetadataTable] {
|
||||||
|
let metadatas = ncDatabase().objects(NextcloudDirectoryMetadataTable.self).filter("account == %@ AND parentDirectoryServerUrl == %@", account, parentDirectoryServerUrl)
|
||||||
|
let sortedMetadatas = metadatas.sorted(byKeyPath: "serverUrl", ascending: true)
|
||||||
|
return Array(sortedMetadatas.map { NextcloudDirectoryMetadataTable(value: $0) })
|
||||||
|
}
|
||||||
|
|
||||||
private func processDirectoryMetadatasToDelete(databaseToWriteTo: Realm,
|
private func processDirectoryMetadatasToDelete(databaseToWriteTo: Realm,
|
||||||
existingDirectoryMetadatas: [NextcloudDirectoryMetadataTable],
|
existingDirectoryMetadatas: [NextcloudDirectoryMetadataTable],
|
||||||
updatedDirectoryMetadatas: [NextcloudDirectoryMetadataTable]) {
|
updatedDirectoryMetadatas: [NextcloudDirectoryMetadataTable]) {
|
||||||
|
|
Loading…
Reference in a new issue