aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/TextProcessing
diff options
context:
space:
mode:
authorJulien Veyssier <julien-nc@posteo.net>2024-08-28 17:26:32 +0200
committerJulien Veyssier <julien-nc@posteo.net>2024-08-30 10:07:01 +0200
commit04edeb510da454c51aaa7d91b6b2b5e6fdb77bbd (patch)
treeb4750203c9df0d138db1ec9b5a6d292ea04ff209 /lib/private/TextProcessing
parent5ab0866341ac21f732117833e41b7deb12971b08 (diff)
downloadnextcloud-server-04edeb510da454c51aaa7d91b6b2b5e6fdb77bbd.tar.gz
nextcloud-server-04edeb510da454c51aaa7d91b6b2b5e6fdb77bbd.zip
feat(speech-to-text): SpeechToTextManager::transcribeFile calls TaskProcessingManager::runTask
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
Diffstat (limited to 'lib/private/TextProcessing')
-rw-r--r--lib/private/TextProcessing/Manager.php11
1 files changed, 7 insertions, 4 deletions
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]);