diff options
author | Jana Peper <jana.peper@nextcloud.com> | 2024-12-08 18:22:08 +0100 |
---|---|---|
committer | janepie <49834966+janepie@users.noreply.github.com> | 2024-12-18 18:32:34 +0100 |
commit | 32b57e7b4120043c1f21ba881914e61e24d8f2a5 (patch) | |
tree | b77b0691ba0015691416ab44bcc734381b0f3d06 /apps/settings/lib/Settings | |
parent | c09ca83053c68e101650555407f5509d6b874d14 (diff) | |
download | nextcloud-server-32b57e7b4120043c1f21ba881914e61e24d8f2a5.tar.gz nextcloud-server-32b57e7b4120043c1f21ba881914e61e24d8f2a5.zip |
feat: save state in db
Signed-off-by: Jana Peper <jana.peper@nextcloud.com>
Diffstat (limited to 'apps/settings/lib/Settings')
-rw-r--r-- | apps/settings/lib/Settings/Admin/ArtificialIntelligence.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/settings/lib/Settings/Admin/ArtificialIntelligence.php b/apps/settings/lib/Settings/Admin/ArtificialIntelligence.php index 4092acecab8..197ea0de283 100644 --- a/apps/settings/lib/Settings/Admin/ArtificialIntelligence.php +++ b/apps/settings/lib/Settings/Admin/ArtificialIntelligence.php @@ -113,12 +113,14 @@ class ArtificialIntelligence implements IDelegatedSettings { } } $taskProcessingTaskTypes = []; + $taskProcessingTypeSettings = []; foreach ($this->taskProcessingManager->getAvailableTaskTypes() as $taskTypeId => $taskTypeDefinition) { $taskProcessingTaskTypes[] = [ 'id' => $taskTypeId, 'name' => $taskTypeDefinition['name'], 'description' => $taskTypeDefinition['description'], ]; + $taskProcessingTypeSettings[$taskTypeId] = true; } $this->initialState->provideInitialState('ai-stt-providers', $sttProviders); @@ -135,6 +137,7 @@ class ArtificialIntelligence implements IDelegatedSettings { 'ai.textprocessing_provider_preferences' => $textProcessingSettings, 'ai.text2image_provider' => count($text2imageProviders) > 0 ? $text2imageProviders[0]['id'] : null, 'ai.taskprocessing_provider_preferences' => $taskProcessingSettings, + 'ai.taskprocessing_type_preferences' => $taskProcessingTypeSettings, ]; foreach ($settings as $key => $defaultValue) { $value = $defaultValue; @@ -143,6 +146,7 @@ class ArtificialIntelligence implements IDelegatedSettings { $value = json_decode($json, true); switch ($key) { case 'ai.taskprocessing_provider_preferences': + case 'ai.taskprocessing_type_preferences': case 'ai.textprocessing_provider_preferences': // fill $value with $defaultValue values $value = array_merge($defaultValue, $value); |