]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
Add convenience method to check if any file metadatas have been stored for account...
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Wed, 1 Feb 2023 17:16:46 +0000 (18:16 +0100)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Fri, 12 May 2023 05:21:17 +0000 (13:21 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/NextcloudFilesDatabaseManager.swift

index 27d8f546edfc07bbb56f7f316f3b5c18172614e9..5de749ed05684206859ef25a3f3a7629f68b6de6 100644 (file)
@@ -74,6 +74,10 @@ class NextcloudFilesDatabaseManager : NSObject {
         return realm
     }
 
+    func anyItemMetadatasForAccount(_ account: String) -> Bool {
+        return !ncDatabase().objects(NextcloudItemMetadataTable.self).filter("account == %@", account).isEmpty
+    }
+
     func itemMetadataFromOcId(_ ocId: String) -> NextcloudItemMetadataTable? {
         // Realm objects are live-fire, i.e. they will be changed and invalidated according to changes in the db
         // Let's therefore create a copy