From: Claudio Cambra Date: Wed, 1 Feb 2023 17:16:46 +0000 (+0100) Subject: Add convenience method to check if any file metadatas have been stored for account... X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~96^2^2~55^2~238 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9c18d36f41acbc8f31003c389872b3b7771baf50;p=nextcloud-desktop.git Add convenience method to check if any file metadatas have been stored for account in NextcloudFilesDatabaseManager Signed-off-by: Claudio Cambra --- diff --git a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/NextcloudFilesDatabaseManager.swift b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/NextcloudFilesDatabaseManager.swift index 27d8f546e..5de749ed0 100644 --- a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/NextcloudFilesDatabaseManager.swift +++ b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/NextcloudFilesDatabaseManager.swift @@ -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