From a52a63fc74cc732a13ebcb1c88c83613a5f07b1f Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Wed, 13 Nov 2024 16:59:46 +0100 Subject: [PATCH] fix(textprocessing): accept scheduling a task if there are equivalent taskprocessing providers only Signed-off-by: Julien Veyssier --- lib/private/TextProcessing/Manager.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; -- 2.39.5