From ba94de2510b3858f10d60f0230a58b1252346372 Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Tue, 5 Mar 2024 11:03:58 +0100 Subject: fix: when no AI setting has been set, make sure the selected text processing provider is the same as the one that will be used Signed-off-by: Julien Veyssier --- apps/settings/lib/Settings/Admin/ArtificialIntelligence.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'apps/settings/lib/Settings') diff --git a/apps/settings/lib/Settings/Admin/ArtificialIntelligence.php b/apps/settings/lib/Settings/Admin/ArtificialIntelligence.php index 20d395ba4d7..41b9e837c7e 100644 --- a/apps/settings/lib/Settings/Admin/ArtificialIntelligence.php +++ b/apps/settings/lib/Settings/Admin/ArtificialIntelligence.php @@ -86,7 +86,9 @@ class ArtificialIntelligence implements IDelegatedSettings { 'name' => $provider->getName(), 'taskType' => $provider->getTaskType(), ]; - $textProcessingSettings[$provider->getTaskType()] = $provider instanceof IProviderWithId ? $provider->getId() : $provider::class; + if (!isset($textProcessingSettings[$provider->getTaskType()])) { + $textProcessingSettings[$provider->getTaskType()] = $provider instanceof IProviderWithId ? $provider->getId() : $provider::class; + } } $textProcessingTaskTypes = []; foreach ($textProcessingSettings as $taskTypeClass => $providerClass) { -- cgit v1.2.3