diff options
author | Marcel Klehr <mklehr@gmx.net> | 2023-04-17 14:49:20 +0200 |
---|---|---|
committer | Marcel Klehr <mklehr@gmx.net> | 2023-04-17 14:57:19 +0200 |
commit | 3779cc3d88ffa65ce312588cccc602a5fbe341f4 (patch) | |
tree | 11a1f76ac3f75b5e6231bf691b508bfb2abd2c97 /lib | |
parent | ad1a0d88ef4a086eb20a743d04f322b9dd888636 (diff) | |
download | nextcloud-server-3779cc3d88ffa65ce312588cccc602a5fbe341f4.tar.gz nextcloud-server-3779cc3d88ffa65ce312588cccc602a5fbe341f4.zip |
SpeechToTextManager: Deduplicate transcription jobs
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/SpeechToText/SpeechToTextManager.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/private/SpeechToText/SpeechToTextManager.php b/lib/private/SpeechToText/SpeechToTextManager.php index 0c41c3cb600..93a74711e32 100644 --- a/lib/private/SpeechToText/SpeechToTextManager.php +++ b/lib/private/SpeechToText/SpeechToTextManager.php @@ -94,6 +94,9 @@ class SpeechToTextManager implements ISpeechToTextManager { throw new PreConditionNotMetException('No SpeechToText providers have been registered'); } try { + if ($this->jobList->has(TranscriptionJob::class, ['fileId' => $file->getId()])) { + return; + } $this->jobList->add(TranscriptionJob::class, ['fileId' => $file->getId()]); } catch (NotFoundException|InvalidPathException $e) { throw new InvalidArgumentException('Invalid file provided for file transcription: ' . $e->getMessage()); |