From 04edeb510da454c51aaa7d91b6b2b5e6fdb77bbd Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Wed, 28 Aug 2024 17:26:32 +0200 Subject: feat(speech-to-text): SpeechToTextManager::transcribeFile calls TaskProcessingManager::runTask Signed-off-by: Julien Veyssier --- lib/private/TextProcessing/Manager.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lib/private/TextProcessing') diff --git a/lib/private/TextProcessing/Manager.php b/lib/private/TextProcessing/Manager.php index c73a6a9ee37..52ca62eaede 100644 --- a/lib/private/TextProcessing/Manager.php +++ b/lib/private/TextProcessing/Manager.php @@ -137,10 +137,13 @@ class Manager implements IManager { $this->logger->debug('Running a TextProcessing (' . $taskTypeClass . ') task with TaskProcessing'); $taskProcessingResultTask = $this->taskProcessingManager->runTask($taskProcessingTask); if ($taskProcessingResultTask->getStatus() === \OCP\TaskProcessing\Task::STATUS_SUCCESSFUL) { - $task->setOutput($taskProcessingResultTask->getOutput()['output'] ?? ''); - $task->setStatus(OCPTask::STATUS_SUCCESSFUL); - $this->taskMapper->update(DbTask::fromPublicTask($task)); - return $task->getOutput(); + $output = $taskProcessingResultTask->getOutput(); + if (isset($output['output']) && is_string($output['output'])) { + $task->setOutput($output['output']); + $task->setStatus(OCPTask::STATUS_SUCCESSFUL); + $this->taskMapper->update(DbTask::fromPublicTask($task)); + return $output['output']; + } } } catch (\Throwable $e) { $this->logger->error('TextProcessing to TaskProcessing failed', ['exception' => $e]); -- cgit v1.2.3