Fix empty text after recognizing

This commit is contained in:
2025-10-23 11:49:56 +03:00
parent 9788f4cd95
commit ec637c08dd

View File

@@ -377,6 +377,10 @@ func (s *TranscribeService) FindAndRunTranscribeCheckJob() error {
"operation_id", opId, "operation_id", opId,
"text_length", len(transcriptionText)) "text_length", len(transcriptionText))
if len(transcriptionText) == 0 {
return s.completeJob(job, "Ой, кажется, на аудиозаписи нет текста.")
}
// Завершаем задачу // Завершаем задачу
return s.completeJob(job, transcriptionText) 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) return fmt.Errorf("failed to save job: %w", err)
} }
// Отправляем распознанный текст обратно пользователю // Отправляем текст об ошибке пользователю
switch job.Source { switch job.Source {
case entity.SourceTelegram: case entity.SourceTelegram:
if job.TgChatId == nil { if job.TgChatId == nil {