diff options
author | Marcel Klehr <mklehr@gmx.net> | 2023-04-19 12:35:13 +0200 |
---|---|---|
committer | Marcel Klehr <mklehr@gmx.net> | 2023-04-19 12:35:13 +0200 |
commit | a2f5421fc3eb13ed28167e97483fa7eaa4e65841 (patch) | |
tree | eec8142c6eb4c88afb3309361a23c64a2d07a554 /lib/private/SpeechToText/SpeechToTextManager.php | |
parent | a8b27c91265a883aaa1563c33edf8d6917af63b1 (diff) | |
download | nextcloud-server-a2f5421fc3eb13ed28167e97483fa7eaa4e65841.tar.gz nextcloud-server-a2f5421fc3eb13ed28167e97483fa7eaa4e65841.zip |
SpeechToTextManager#scheduleFileTranscription: Take context params and expose them on the Transcription*Events
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Diffstat (limited to 'lib/private/SpeechToText/SpeechToTextManager.php')
-rw-r--r-- | lib/private/SpeechToText/SpeechToTextManager.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/private/SpeechToText/SpeechToTextManager.php b/lib/private/SpeechToText/SpeechToTextManager.php index d6f7e74c95e..95208e5b0ca 100644 --- a/lib/private/SpeechToText/SpeechToTextManager.php +++ b/lib/private/SpeechToText/SpeechToTextManager.php @@ -90,12 +90,17 @@ class SpeechToTextManager implements ISpeechToTextManager { return !empty($context->getSpeechToTextProviders()); } - public function scheduleFileTranscription(File $file): void { + public function scheduleFileTranscription(File $file, string $userId, string $appId): void { if (!$this->hasProviders()) { throw new PreConditionNotMetException('No SpeechToText providers have been registered'); } try { - $this->jobList->add(TranscriptionJob::class, ['fileId' => $file->getId(), 'owner' => $file->getOwner()->getUID()]); + $this->jobList->add(TranscriptionJob::class, [ + 'fileId' => $file->getId(), + 'owner' => $file->getOwner()->getUID(), + 'userId' => $userId, + 'appId' => $appId, + ]); } catch (NotFoundException|InvalidPathException $e) { throw new InvalidArgumentException('Invalid file provided for file transcription: ' . $e->getMessage()); } |