Fix empty text after recognizing
This commit is contained in:
@@ -377,6 +377,10 @@ func (s *TranscribeService) FindAndRunTranscribeCheckJob() error {
|
||||
"operation_id", opId,
|
||||
"text_length", len(transcriptionText))
|
||||
|
||||
if len(transcriptionText) == 0 {
|
||||
return s.completeJob(job, "Ой, кажется, на аудиозаписи нет текста.")
|
||||
}
|
||||
|
||||
// Завершаем задачу
|
||||
return s.completeJob(job, transcriptionText)
|
||||
}
|
||||
@@ -436,7 +440,7 @@ func (s *TranscribeService) failJob(job *entity.TranscribeJob, jobErr error, hum
|
||||
return fmt.Errorf("failed to save job: %w", err)
|
||||
}
|
||||
|
||||
// Отправляем распознанный текст обратно пользователю
|
||||
// Отправляем текст об ошибке пользователю
|
||||
switch job.Source {
|
||||
case entity.SourceTelegram:
|
||||
if job.TgChatId == nil {
|
||||
|
||||
Reference in New Issue
Block a user