]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(textprocessing): accept scheduling a task if there are equivalent taskprocessing... fix/noid/textprocessing-schedule-taskprocessing-provider 49260/head
authorJulien Veyssier <julien-nc@posteo.net>
Wed, 13 Nov 2024 15:59:46 +0000 (16:59 +0100)
committerJulien Veyssier <julien-nc@posteo.net>
Wed, 13 Nov 2024 15:59:46 +0000 (16:59 +0100)
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
lib/private/TextProcessing/Manager.php

index fcb5fb31d74f302fc3316b097407b575d71c6f92..3fe45ce55ece2d49c8f9907a1297da3b5af5d4c9 100644 (file)
@@ -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;