diff options
Diffstat (limited to 'core/Command')
-rw-r--r-- | core/Command/Config/Preset.php | 10 | ||||
-rw-r--r-- | core/Command/TaskProcessing/EnabledCommand.php | 8 |
2 files changed, 8 insertions, 10 deletions
diff --git a/core/Command/Config/Preset.php b/core/Command/Config/Preset.php index 4f0278896db..ebd8aaa5cdf 100644 --- a/core/Command/Config/Preset.php +++ b/core/Command/Config/Preset.php @@ -8,10 +8,9 @@ declare(strict_types=1); */ namespace OC\Core\Command\Config; -use OC\Config\ConfigManager; +use OC\Config\PresetManager; use OC\Core\Command\Base; use OCP\Config\Lexicon\Preset as ConfigLexiconPreset; -use OCP\IConfig; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -19,8 +18,7 @@ use Symfony\Component\Console\Output\OutputInterface; class Preset extends Base { public function __construct( - private readonly IConfig $config, - private readonly ConfigManager $configManager, + private readonly PresetManager $presetManager, ) { parent::__construct(); } @@ -49,10 +47,10 @@ class Preset extends Base { return self::INVALID; } - $this->configManager->setLexiconPreset($preset); + $this->presetManager->setLexiconPreset($preset); } - $current = ConfigLexiconPreset::tryFrom($this->config->getSystemValueInt(ConfigManager::PRESET_CONFIGKEY, 0)) ?? ConfigLexiconPreset::NONE; + $current = $this->presetManager->getLexiconPreset(); $this->writeArrayInOutputFormat($input, $output, [$current->name], 'current preset: '); return self::SUCCESS; } diff --git a/core/Command/TaskProcessing/EnabledCommand.php b/core/Command/TaskProcessing/EnabledCommand.php index 7195d19a7a4..0d4b831812c 100644 --- a/core/Command/TaskProcessing/EnabledCommand.php +++ b/core/Command/TaskProcessing/EnabledCommand.php @@ -7,7 +7,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 +16,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 +41,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 +51,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) { |