mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
SpeechToTextManager: Deduplicate transcription jobs
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
This commit is contained in:
parent
ad1a0d88ef
commit
3779cc3d88
1 changed files with 3 additions and 0 deletions
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Reference in a new issue