diff --git a/lib/Capabilities.php b/lib/Capabilities.php index 7979325..c197d72 100644 --- a/lib/Capabilities.php +++ b/lib/Capabilities.php @@ -6,19 +6,28 @@ * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ + namespace OCA\Files_DownloadLimit; +use OCA\Files_DownloadLimit\AppInfo\Application; use OCP\Capabilities\ICapability; +use OCP\IAppConfig; class Capabilities implements ICapability { + public function __construct( + private readonly IAppConfig $config + ) { + } + /** - * @return array{downloadlimit: array{enabled: true}} + * @return array{downloadlimit: array{'default-limit': int, enabled: true}} */ public function getCapabilities(): array { return [ 'downloadlimit' => [ - 'enabled' => true + 'enabled' => true, + 'default-limit' => $this->config->getValueInt(Application::APP_ID, 'default-download-limit', -1), ] ]; }