Skip to content

Commit

Permalink
#3184: Download Limit Support
Browse files Browse the repository at this point in the history
- Added tableDownloadLimit entity to app database.
- Extended capability query to also consider download limit app.
- Extended capabilities list view for display of download limit availability.
- Extended share detail user interface to mimic the web user interface for managing download limits.
- Every time WebDAV properties of a file are retrieved, its associated download limits are removed and recreated.

Housekeeping:
- Outsourced NCShareDateCell into dedicated source code file.
- Outsourced NCShareToggleCell into dedicated source code file.

Notes:
- In my first attempt I had a detail view in the download limit row of the advanced share options showing the remaining number of downloads. However, that required to inject and retain the download limit entity object into the complicated share table configuration object. That, in turn, results in inconsistent data state due to invalid and outdated references. To resolve those issues, the assembly of the advanced share options user interface needs some refactoring which appears to expansive at this point and I prefer to leave it as it is for now.

Signed-off-by: Iva Horn <[email protected]>
  • Loading branch information
i2h3 committed Nov 22, 2024
1 parent 2b87a21 commit f6886b2
Show file tree
Hide file tree
Showing 19 changed files with 781 additions and 126 deletions.
2 changes: 1 addition & 1 deletion Brand/Database.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ import Foundation
// Database Realm
//
let databaseName = "nextcloud.realm"
let databaseSchemaVersion: UInt64 = 367
let databaseSchemaVersion: UInt64 = 368
46 changes: 46 additions & 0 deletions Nextcloud.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@
371B5A2E23D0B04500FAFAE9 /* NCMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 371B5A2D23D0B04500FAFAE9 /* NCMenu.swift */; };
3781B9B023DB2B7E006B4B1D /* AppDelegate+Menu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3781B9AF23DB2B7E006B4B1D /* AppDelegate+Menu.swift */; };
8491B1CD273BBA82001C8C5B /* UIViewController+Menu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8491B1CC273BBA82001C8C5B /* UIViewController+Menu.swift */; };
AA3494FE2CE65EB6005CC075 /* NCManageDatabase+DownloadLimit.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3494FD2CE65EA9005CC075 /* NCManageDatabase+DownloadLimit.swift */; };
AA3494FF2CE65EB6005CC075 /* NCManageDatabase+DownloadLimit.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3494FD2CE65EA9005CC075 /* NCManageDatabase+DownloadLimit.swift */; };
AA3495002CE65EB6005CC075 /* NCManageDatabase+DownloadLimit.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3494FD2CE65EA9005CC075 /* NCManageDatabase+DownloadLimit.swift */; };
AA3495012CE65EB6005CC075 /* NCManageDatabase+DownloadLimit.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3494FD2CE65EA9005CC075 /* NCManageDatabase+DownloadLimit.swift */; };
AA3495022CE65EB6005CC075 /* NCManageDatabase+DownloadLimit.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3494FD2CE65EA9005CC075 /* NCManageDatabase+DownloadLimit.swift */; };
AA3495032CE65EB6005CC075 /* NCManageDatabase+DownloadLimit.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3494FD2CE65EA9005CC075 /* NCManageDatabase+DownloadLimit.swift */; };
AA3495042CE65EB6005CC075 /* NCManageDatabase+DownloadLimit.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3494FD2CE65EA9005CC075 /* NCManageDatabase+DownloadLimit.swift */; };
AAAC0A122CEE34700001949E /* NCShareDownloadLimitNetworking.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAAC0A112CEE346A0001949E /* NCShareDownloadLimitNetworking.swift */; };
AAF806B22CE25E67009C2D43 /* NCShareDateCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAF806B12CE25E60009C2D43 /* NCShareDateCell.swift */; };
AAF806B42CE25EFF009C2D43 /* NCShareToggleCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAF806B32CE25EFE009C2D43 /* NCShareToggleCell.swift */; };
AAF806B62CE34C7A009C2D43 /* NCShareDownloadLimitViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAF806B52CE34C72009C2D43 /* NCShareDownloadLimitViewController.swift */; };
AAF806B82CE37C1A009C2D43 /* NCShareDownloadLimitTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAF806B72CE37C15009C2D43 /* NCShareDownloadLimitTableViewController.swift */; };
AF1A9B6427D0CA1E00F17A9E /* UIAlertController+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF1A9B6327D0CA1E00F17A9E /* UIAlertController+Extension.swift */; };
AF1A9B6527D0CC0500F17A9E /* UIAlertController+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF1A9B6327D0CA1E00F17A9E /* UIAlertController+Extension.swift */; };
AF22B206277B4E4C00DAB0CC /* NCCreateFormUploadConflict.swift in Sources */ = {isa = PBXBuildFile; fileRef = F704B5E42430AA8000632F5F /* NCCreateFormUploadConflict.swift */; };
Expand Down Expand Up @@ -1152,6 +1164,13 @@
371B5A2D23D0B04500FAFAE9 /* NCMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMenu.swift; sourceTree = "<group>"; };
3781B9AF23DB2B7E006B4B1D /* AppDelegate+Menu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AppDelegate+Menu.swift"; sourceTree = "<group>"; };
8491B1CC273BBA82001C8C5B /* UIViewController+Menu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIViewController+Menu.swift"; sourceTree = "<group>"; };
AA3494FD2CE65EA9005CC075 /* NCManageDatabase+DownloadLimit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NCManageDatabase+DownloadLimit.swift"; sourceTree = "<group>"; };
AAAC0A112CEE346A0001949E /* NCShareDownloadLimitNetworking.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCShareDownloadLimitNetworking.swift; sourceTree = "<group>"; };
AAF806B12CE25E60009C2D43 /* NCShareDateCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCShareDateCell.swift; sourceTree = "<group>"; };
AAF806B32CE25EFE009C2D43 /* NCShareToggleCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCShareToggleCell.swift; sourceTree = "<group>"; };
AAF806B52CE34C72009C2D43 /* NCShareDownloadLimitViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCShareDownloadLimitViewController.swift; sourceTree = "<group>"; };
AAF806B72CE37C15009C2D43 /* NCShareDownloadLimitTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCShareDownloadLimitTableViewController.swift; sourceTree = "<group>"; };
AAF806B92CE38BB2009C2D43 /* NextcloudKit */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = NextcloudKit; path = ../NextcloudKit; sourceTree = SOURCE_ROOT; };
AF1A9B6327D0CA1E00F17A9E /* UIAlertController+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIAlertController+Extension.swift"; sourceTree = "<group>"; };
AF22B20B277C6F4D00DAB0CC /* NCShareCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCShareCell.swift; sourceTree = "<group>"; };
AF22B215277D196700DAB0CC /* NCShareExtension+DataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NCShareExtension+DataSource.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1921,6 +1940,15 @@
path = Menu;
sourceTree = "<group>";
};
AA3494FC2CE4FF02005CC075 /* DownloadLimit */ = {
isa = PBXGroup;
children = (
AAF806B52CE34C72009C2D43 /* NCShareDownloadLimitViewController.swift */,
AAF806B72CE37C15009C2D43 /* NCShareDownloadLimitTableViewController.swift */,
);
path = DownloadLimit;
sourceTree = "<group>";
};
AF8ED1FA2757821000B8DBC4 /* NextcloudUnitTests */ = {
isa = PBXGroup;
children = (
Expand All @@ -1932,11 +1960,14 @@
AF93471327E235EB002537EE /* Advanced */ = {
isa = PBXGroup;
children = (
AA3494FC2CE4FF02005CC075 /* DownloadLimit */,
AF93471627E2361E002537EE /* NCShareAdvancePermission.swift */,
AF93471827E2361E002537EE /* NCShareAdvancePermissionFooter.swift */,
AF93471427E2361E002537EE /* NCShareAdvancePermissionFooter.xib */,
AFCE353627E4ED7B00FEA6C2 /* NCShareCells.swift */,
AAF806B12CE25E60009C2D43 /* NCShareDateCell.swift */,
AF93474D27E3F211002537EE /* NCShareNewUserAddComment.swift */,
AAF806B32CE25EFE009C2D43 /* NCShareToggleCell.swift */,
);
path = Advanced;
sourceTree = "<group>";
Expand Down Expand Up @@ -2148,6 +2179,7 @@
F787704E22E7019900F287A9 /* NCShareLinkCell.xib */,
AF2D7C7B2742556F00ADF566 /* NCShareLinkCell.swift */,
F769454722E9F20D000A798A /* NCShareNetworking.swift */,
AAAC0A112CEE346A0001949E /* NCShareDownloadLimitNetworking.swift */,
F769453F22E9F077000A798A /* NCSharePaging.swift */,
F774264822EB4D0000B23912 /* NCSearchUserDropDownCell.xib */,
F769453B22E9CFFF000A798A /* NCShareUserCell.xib */,
Expand Down Expand Up @@ -2678,6 +2710,7 @@
F7BAAD951ED5A63D00B7EAD4 /* Data */ = {
isa = PBXGroup;
children = (
AA3494FD2CE65EA9005CC075 /* NCManageDatabase+DownloadLimit.swift */,
F7BAADB51ED5A87C00B7EAD4 /* NCManageDatabase.swift */,
AF4BF613275629E20081CEEF /* NCManageDatabase+Account.swift */,
AF4BF61D27562B3F0081CEEF /* NCManageDatabase+Activity.swift */,
Expand Down Expand Up @@ -3014,6 +3047,7 @@
F7F67B9F1A24D27800EE80DA = {
isa = PBXGroup;
children = (
AAF806B92CE38BB2009C2D43 /* NextcloudKit */,
F7B8B82F25681C3400967775 /* GoogleService-Info.plist */,
F7C1CDD91E6DFC6F005D92BE /* Brand */,
F7F67BAA1A24D27800EE80DA /* iOSClient */,
Expand Down Expand Up @@ -3844,6 +3878,7 @@
F711A4E22AF92CAE00095DD8 /* NCUtility+Date.swift in Sources */,
F7401C1B2C75E6F300649E87 /* NCCapabilities.swift in Sources */,
AF4BF61C27562A4B0081CEEF /* NCManageDatabase+Metadata.swift in Sources */,
AA3495022CE65EB6005CC075 /* NCManageDatabase+DownloadLimit.swift in Sources */,
F78E2D6B29AF02DB0024D4F3 /* Database.swift in Sources */,
F7817CFF29802D1A00FFBC65 /* NCPushNotificationEncryption.m in Sources */,
F798F0EC2588060A000DAFFD /* UIColor+Extension.swift in Sources */,
Expand Down Expand Up @@ -3916,6 +3951,7 @@
F711A4E12AF92CAE00095DD8 /* NCUtility+Date.swift in Sources */,
F76882382C0DD22F001CF441 /* NCKeychain.swift in Sources */,
F7C9B9222B582F550064EA91 /* NCManageDatabase+SecurityGuard.swift in Sources */,
AA3495032CE65EB6005CC075 /* NCManageDatabase+DownloadLimit.swift in Sources */,
F7490E8529882C8C009DCE94 /* NCManageDatabase+Video.swift in Sources */,
F7490E7729882C10009DCE94 /* UIColor+Extension.swift in Sources */,
F70716E62987F81500E72C1D /* DocumentActionViewController.swift in Sources */,
Expand Down Expand Up @@ -3964,6 +4000,7 @@
F73EF7DA2B0226080087E6E9 /* NCManageDatabase+Tip.swift in Sources */,
F7817CFB29801A3500FFBC65 /* Data+Extension.swift in Sources */,
F72429362AFE39860040AEF3 /* NCLivePhoto.swift in Sources */,
AA3494FF2CE65EB6005CC075 /* NCManageDatabase+DownloadLimit.swift in Sources */,
AF4BF61F27562B3F0081CEEF /* NCManageDatabase+Activity.swift in Sources */,
F7CBC1262BAC8B0000EC1D55 /* NCSectionFirstHeaderEmptyData.swift in Sources */,
F7A0D1362591FBC5008F8A13 /* String+Extension.swift in Sources */,
Expand Down Expand Up @@ -4086,6 +4123,7 @@
F783030328B4C4DD00B84583 /* ThreadSafeDictionary.swift in Sources */,
F77ED59128C9CE9D00E24ED0 /* ToolbarData.swift in Sources */,
F78302F728B4C3C900B84583 /* NCManageDatabase.swift in Sources */,
AA3495042CE65EB6005CC075 /* NCManageDatabase+DownloadLimit.swift in Sources */,
F359D8682A7D03420023F405 /* NCUtility+Exif.swift in Sources */,
F7346E1628B0EF5C006CE2D2 /* Widget.swift in Sources */,
F78302F828B4C3E100B84583 /* NCManageDatabase+Activity.swift in Sources */,
Expand Down Expand Up @@ -4218,6 +4256,7 @@
F7327E392B73B8D400A462C7 /* Array+Extension.swift in Sources */,
F78E2D6929AF02DB0024D4F3 /* Database.swift in Sources */,
F749B64E297B0CBB00087535 /* NCManageDatabase+Share.swift in Sources */,
AA3494FE2CE65EB6005CC075 /* NCManageDatabase+DownloadLimit.swift in Sources */,
F73EF7B32B0224350087E6E9 /* NCManageDatabase+DirectEditing.swift in Sources */,
F7401C192C75E6F300649E87 /* NCCapabilities.swift in Sources */,
F771E3F320E239A600AFB62D /* FileProviderData.swift in Sources */,
Expand Down Expand Up @@ -4329,6 +4368,7 @@
F758B460212C56A400515F55 /* NCScan.swift in Sources */,
F76882262C0DD1E7001CF441 /* NCSettingsView.swift in Sources */,
F78ACD52219046DC0088454D /* NCSectionFirstHeader.swift in Sources */,
AAF806B42CE25EFF009C2D43 /* NCShareToggleCell.swift in Sources */,
F72944F52A8424F800246839 /* NCEndToEndMetadataV1.swift in Sources */,
F710D2022405826100A6033D /* NCViewer+Menu.swift in Sources */,
F765E9CD295C585800A09ED8 /* NCUploadScanDocument.swift in Sources */,
Expand Down Expand Up @@ -4366,6 +4406,7 @@
F7D4BF472CA2E8D800A5E746 /* TOSettingsKeypadImage.m in Sources */,
F7D4BF482CA2E8D800A5E746 /* TOPasscodeSettingsWarningLabel.m in Sources */,
F7D4BF492CA2E8D800A5E746 /* TOPasscodeVariableInputView.m in Sources */,
AA3495012CE65EB6005CC075 /* NCManageDatabase+DownloadLimit.swift in Sources */,
F7D4BF4A2CA2E8D800A5E746 /* TOPasscodeCircleView.m in Sources */,
F7D4BF4B2CA2E8D800A5E746 /* TOPasscodeViewContentLayout.m in Sources */,
F7D4BF4C2CA2E8D800A5E746 /* TOPasscodeSettingsKeypadButton.m in Sources */,
Expand Down Expand Up @@ -4407,6 +4448,7 @@
F7EB9B132BBC12F300EDF036 /* UIApplication+Extension.swift in Sources */,
F7E98C1627E0D0FC001F9F19 /* NCManageDatabase+Video.swift in Sources */,
F7F4F11227ECDC52008676F9 /* UIFont+Extension.swift in Sources */,
AAF806B62CE34C7A009C2D43 /* NCShareDownloadLimitViewController.swift in Sources */,
F76882222C0DD1E7001CF441 /* NCCapabilitiesView.swift in Sources */,
AF93471A27E2361E002537EE /* NCShareHeader.swift in Sources */,
F7F878AE1FB9E3B900599E4F /* NCEndToEndMetadata.swift in Sources */,
Expand Down Expand Up @@ -4494,6 +4536,7 @@
F77C97392953131000FDDD09 /* NCCameraRoll.swift in Sources */,
F343A4B32A1E01FF00DDA874 /* PHAsset+Extension.swift in Sources */,
F70968A424212C4E00ED60E5 /* NCLivePhoto.swift in Sources */,
AAF806B22CE25E67009C2D43 /* NCShareDateCell.swift in Sources */,
F7C30DFA291BCF790017149B /* NCNetworkingE2EECreateFolder.swift in Sources */,
F7BC288026663F85004D46C5 /* NCViewCertificateDetails.swift in Sources */,
F78B87E92B62550800C65ADC /* NCMediaDownloadThumbnail.swift in Sources */,
Expand All @@ -4515,8 +4558,10 @@
F7D68FCC28CB9051009139F3 /* NCManageDatabase+DashboardWidget.swift in Sources */,
F76882292C0DD1E7001CF441 /* NCManageE2EEModel.swift in Sources */,
F799DF8B2C4B84EB003410B5 /* NCCollectionViewCommon+EndToEndInitialize.swift in Sources */,
AAAC0A122CEE34700001949E /* NCShareDownloadLimitNetworking.swift in Sources */,
F78E2D6529AF02DB0024D4F3 /* Database.swift in Sources */,
F70CEF5623E9C7E50007035B /* UIColor+Extension.swift in Sources */,
AAF806B82CE37C1A009C2D43 /* NCShareDownloadLimitTableViewController.swift in Sources */,
F76882242C0DD1E7001CF441 /* NCSettingsAdvancedView.swift in Sources */,
F75CA1472962F13700B01130 /* NCHUDView.swift in Sources */,
F77BB748289985270090FC19 /* UITabBarController+Extension.swift in Sources */,
Expand Down Expand Up @@ -4558,6 +4603,7 @@
F7C9739528F17131002C43E2 /* IntentHandler.swift in Sources */,
F7A8D73D28F181D3008BBE1C /* NCUtilityFileSystem.swift in Sources */,
F73EF7E12B02266D0087E6E9 /* NCManageDatabase+Trash.swift in Sources */,
AA3495002CE65EB6005CC075 /* NCManageDatabase+DownloadLimit.swift in Sources */,
F7C9B91F2B582F550064EA91 /* NCManageDatabase+SecurityGuard.swift in Sources */,
F75DD767290ABB25002EB562 /* Intent.intentdefinition in Sources */,
F72437812C10B92500C7C68D /* NCPermissions.swift in Sources */,
Expand Down
9 changes: 9 additions & 0 deletions iOSClient/Data/NCManageDatabase+Capabilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ extension NCManageDatabase {
}

struct Capabilities: Codable {
let downloadLimit: DownloadLimit?
let filessharing: FilesSharing?
let theming: Theming?
let endtoendencryption: EndToEndEncryption?
Expand All @@ -102,6 +103,7 @@ extension NCManageDatabase {
let assistant: Assistant?

enum CodingKeys: String, CodingKey {
case downloadLimit = "downloadlimit"
case filessharing = "files_sharing"
case theming
case endtoendencryption = "end-to-end-encryption"
Expand All @@ -112,6 +114,11 @@ extension NCManageDatabase {
case assistant
}

struct DownloadLimit: Codable {
let enabled: Bool?
let defaultLimit: Int?
}

struct FilesSharing: Codable {
let apienabled: Bool?
let groupsharing: Bool?
Expand Down Expand Up @@ -327,6 +334,8 @@ extension NCManageDatabase {
capabilities.capabilityFileSharingInternalExpireDateDays = data.capabilities.filessharing?.ncpublic?.expiredateinternal?.days ?? 0
capabilities.capabilityFileSharingRemoteExpireDateEnforced = data.capabilities.filessharing?.ncpublic?.expiredateremote?.enforced ?? false
capabilities.capabilityFileSharingRemoteExpireDateDays = data.capabilities.filessharing?.ncpublic?.expiredateremote?.days ?? 0
capabilities.capabilityFileSharingDownloadLimit = data.capabilities.downloadLimit?.enabled ?? false
capabilities.capabilityFileSharingDownloadLimitDefaultLimit = data.capabilities.downloadLimit?.defaultLimit ?? 1

capabilities.capabilityThemingColor = data.capabilities.theming?.color ?? ""
capabilities.capabilityThemingColorElement = data.capabilities.theming?.colorelement ?? ""
Expand Down
95 changes: 95 additions & 0 deletions iOSClient/Data/NCManageDatabase+DownloadLimit.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2024 Iva Horn
// SPDX-License-Identifier: GPL-3.0-or-later

import Foundation
import NextcloudKit
import RealmSwift

///
/// Data model for storing information about download limits of shares.
///
class tableDownloadLimit: Object {
///
/// The number of downloads which already happened.
///
@Persisted
@objc dynamic var count: Int = 0

///
/// Total number of allowed downloas.
///
@Persisted
@objc dynamic var limit: Int = 0

///
/// The token identifying the related share.
///
@Persisted(primaryKey: true)
@objc dynamic var token: String = ""
}

extension NCManageDatabase {
///
/// Create a new download limit object in the database.
///
@discardableResult
func createDownloadLimit(count: Int, limit: Int, token: String) throws -> tableDownloadLimit? {
let downloadLimit = tableDownloadLimit()
downloadLimit.count = count
downloadLimit.limit = limit
downloadLimit.token = token

do {
let realm = try Realm()

try realm.write {
realm.add(downloadLimit, update: .all)
}
} catch let error as NSError {
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not write to database: \(error)")
}

return downloadLimit
}

///
/// Delete an existing download limit object identified by the token of its related share.
///
/// - Parameter token: The `token` of the associated ``Nextcloud/tableShare/token``.
///
func deleteDownloadLimit(byShareToken token: String) throws {
do {
let realm = try Realm()

try realm.write {
let result = realm.objects(tableDownloadLimit.self).filter("token == %@", token)
realm.delete(result)
}
} catch let error as NSError {
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not write to database: \(error)")
}
}

///
/// Retrieve a download limit by the token of the associated ``Nextcloud/tableShare/token``.
///
/// - Parameter token: The `token` of the associated ``tableShare``.
///
func getDownloadLimit(byShareToken token: String) throws -> tableDownloadLimit? {
do {
let realm = try Realm()
let predicate = NSPredicate(format: "token == %@", token)

guard let result = realm.objects(tableDownloadLimit.self).filter(predicate).first else {
return nil
}

return result
} catch let error as NSError {
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not access database: \(error)")
}

return nil
}
}
Loading

0 comments on commit f6886b2

Please sign in to comment.