fix(cli): понятный прогресс OpenVINO + единый цвет пути в выводе

- Зачем:
  - индикатор "00:32 / 16:02" был неочевиден — два одинаковых формата.
  - путь в "Транскрипт сохранён" отображался разным цветом из-за Rich bold-разметки.
- Что:
  - формат прогресса: "Транскрибирую 16 мин аудио (OpenVINO)... прошло 00:32".
  - путь выводится в кавычках без bold-разметки, единым цветом.
- Проверка:
  - uv run pytest -q — 124 passed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-22 12:04:42 +03:00
co-authored by Claude Opus 4.6
parent f42d3ae842
commit aac6b0f3d6
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -106,7 +106,8 @@ class OpenVINOBackend:
if language: if language:
kwargs["language"] = f"<|{language}|>" kwargs["language"] = f"<|{language}|>"
duration_str = f"{int(duration // 60):02d}:{int(duration % 60):02d}" dur_min = int(duration // 60)
duration_str = f"{dur_min} мин" if dur_min > 0 else f"{int(duration)} сек"
pcm_list = raw_speech.tolist() pcm_list = raw_speech.tolist()
result = _generate_with_progress(model, pcm_list, kwargs, duration_str, on_status) result = _generate_with_progress(model, pcm_list, kwargs, duration_str, on_status)
@@ -200,7 +201,7 @@ def _generate_with_progress(
while thread.is_alive(): while thread.is_alive():
elapsed = int(time.monotonic() - start) elapsed = int(time.monotonic() - start)
elapsed_str = f"{elapsed // 60:02d}:{elapsed % 60:02d}" elapsed_str = f"{elapsed // 60:02d}:{elapsed % 60:02d}"
_notify(on_status, f"Транскрибирую (OpenVINO)... {elapsed_str} / {duration_str} аудио") _notify(on_status, f"Транскрибирую {duration_str} аудио (OpenVINO)... прошло {elapsed_str}")
thread.join(timeout=1.0) thread.join(timeout=1.0)
if error_box[0] is not None: if error_box[0] is not None:
+1 -1
View File
@@ -200,7 +200,7 @@ def _run_single(
write_transcript(content, output_path) write_transcript(content, output_path)
elapsed = time.monotonic() - start elapsed = time.monotonic() - start
console.print(f"Транскрипт сохранён: [bold]{output_path}[/bold]", style="green") console.print(f"Транскрипт сохранён: \"{output_path}\"", style="green")
console.print(f" Сегментов: {len(result.segments)} Время: {elapsed:.1f}с") console.print(f" Сегментов: {len(result.segments)} Время: {elapsed:.1f}с")