Skip to content

Commit

Permalink
Feature: expose default-limit to capabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasKaminsky committed Nov 14, 2024
1 parent e8f0141 commit 6260df1
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/Capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
]
];
}
Expand Down

0 comments on commit 6260df1

Please sign in to comment.