From: Julien Veyssier Date: Wed, 13 Nov 2024 15:59:46 +0000 (+0100) Subject: fix(textprocessing): accept scheduling a task if there are equivalent taskprocessing... X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a52a63fc74cc732a13ebcb1c88c83613a5f07b1f;p=nextcloud-server.git fix(textprocessing): accept scheduling a task if there are equivalent taskprocessing providers only Signed-off-by: Julien Veyssier --- diff --git a/lib/private/TextProcessing/Manager.php b/lib/private/TextProcessing/Manager.php index fcb5fb31d74..3fe45ce55ec 100644 --- a/lib/private/TextProcessing/Manager.php +++ b/lib/private/TextProcessing/Manager.php @@ -221,7 +221,11 @@ class Manager implements IManager { } $task->setStatus(OCPTask::STATUS_SCHEDULED); $providers = $this->getPreferredProviders($task); - if (count($providers) === 0) { + $equivalentTaskProcessingTypeAvailable = ( + isset(self::$taskProcessingCompatibleTaskTypes[$task->getType()]) + && isset($this->taskProcessingManager->getAvailableTaskTypes()[self::$taskProcessingCompatibleTaskTypes[$task->getType()]]) + ); + if (count($providers) === 0 && !$equivalentTaskProcessingTypeAvailable) { throw new PreConditionNotMetException('No LanguageModel provider is installed that can handle this task'); } [$provider,] = $providers;