Add model auto-download and English logging

This commit is contained in:
Dymas
2026-06-06 12:47:59 +02:00
parent d8b92d5025
commit 0c7f93d067
17 changed files with 204 additions and 77 deletions
+4 -4
View File
@@ -49,12 +49,12 @@ def save_history(result: Dict[str, Any], original_filename: str, config: Dict) -
with open(history_path, 'w', encoding='utf-8') as f:
json.dump(result, f, ensure_ascii=False, indent=2)
logger.info("Результат сохранён в историю: %s", history_path)
logger.info("Saved transcription result to history: %s", history_path)
_cleanup_old_history(config)
return history_path
except Exception as e:
logger.error("Ошибка при сохранении истории: %s", e)
logger.error("Failed to save history: %s", e)
return None
@@ -80,6 +80,6 @@ def _cleanup_old_history(config: Dict) -> None:
# Директории имеют формат YYYY-MM-DD
if len(entry) == 10 and entry < cutoff_str:
shutil.rmtree(entry_path, ignore_errors=True)
logger.info("Удалена старая директория истории: %s", entry)
logger.info("Removed old history directory: %s", entry)
except Exception as e:
logger.warning("Ошибка при очистке старой истории: %s", e)
logger.warning("Failed to clean up old history: %s", e)