summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMarcel Klehr <mklehr@gmx.net>2023-04-17 14:49:20 +0200
committerMarcel Klehr <mklehr@gmx.net>2023-04-17 14:57:19 +0200
commit3779cc3d88ffa65ce312588cccc602a5fbe341f4 (patch)
tree11a1f76ac3f75b5e6231bf691b508bfb2abd2c97 /lib
parentad1a0d88ef4a086eb20a743d04f322b9dd888636 (diff)
downloadnextcloud-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.php3
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());