aboutsummaryrefslogtreecommitdiffstats
path: root/core/Command/TaskProcessing/EnabledCommand.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/Command/TaskProcessing/EnabledCommand.php')
-rw-r--r--core/Command/TaskProcessing/EnabledCommand.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/core/Command/TaskProcessing/EnabledCommand.php b/core/Command/TaskProcessing/EnabledCommand.php
index 7195d19a7a4..a99e3e001b9 100644
--- a/core/Command/TaskProcessing/EnabledCommand.php
+++ b/core/Command/TaskProcessing/EnabledCommand.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
/**
* SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
@@ -7,7 +9,7 @@
namespace OC\Core\Command\TaskProcessing;
use OC\Core\Command\Base;
-use OCP\IConfig;
+use OCP\IAppConfig;
use OCP\TaskProcessing\IManager;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
@@ -16,7 +18,7 @@ use Symfony\Component\Console\Output\OutputInterface;
class EnabledCommand extends Base {
public function __construct(
protected IManager $taskProcessingManager,
- private IConfig $config,
+ private IAppConfig $appConfig,
) {
parent::__construct();
}
@@ -41,7 +43,7 @@ class EnabledCommand extends Base {
protected function execute(InputInterface $input, OutputInterface $output): int {
$enabled = (bool)$input->getArgument('enabled');
$taskType = $input->getArgument('task-type-id');
- $json = $this->config->getAppValue('core', 'ai.taskprocessing_type_preferences');
+ $json = $this->appConfig->getValueString('core', 'ai.taskprocessing_type_preferences', lazy: true);
try {
if ($json === '') {
$taskTypeSettings = [];
@@ -51,7 +53,7 @@ class EnabledCommand extends Base {
$taskTypeSettings[$taskType] = $enabled;
- $this->config->setAppValue('core', 'ai.taskprocessing_type_preferences', json_encode($taskTypeSettings));
+ $this->appConfig->setValueString('core', 'ai.taskprocessing_type_preferences', json_encode($taskTypeSettings), lazy: true);
$this->writeArrayInOutputFormat($input, $output, $taskTypeSettings);
return 0;
} catch (\JsonException $e) {