mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
move setting of userId before provider execution
Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
This commit is contained in:
parent
13588c7566
commit
ea7f1f9ecd
1 changed files with 3 additions and 3 deletions
|
|
@ -126,9 +126,6 @@ class SpeechToTextManager implements ISpeechToTextManager {
|
|||
if ($provider instanceof ISpeechToTextProviderWithId) {
|
||||
return $provider->getId() === $classNameOrId;
|
||||
}
|
||||
if ($provider instanceof ISpeechToTextProviderWithUserId) {
|
||||
$provider->setUserId($this->userSession->getUser()?->getUID());
|
||||
}
|
||||
return $provider::class === $classNameOrId;
|
||||
}));
|
||||
if ($provider !== false) {
|
||||
|
|
@ -138,6 +135,9 @@ class SpeechToTextManager implements ISpeechToTextManager {
|
|||
|
||||
foreach ($providers as $provider) {
|
||||
try {
|
||||
if ($provider instanceof ISpeechToTextProviderWithUserId) {
|
||||
$provider->setUserId($this->userSession->getUser()?->getUID());
|
||||
}
|
||||
return $provider->transcribeFile($file);
|
||||
} catch (\Throwable $e) {
|
||||
$this->logger->info('SpeechToText transcription using provider ' . $provider->getName() . ' failed', ['exception' => $e]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue