diff --git a/config.py b/config.py index 8110354..9b091ae 100644 --- a/config.py +++ b/config.py @@ -28,6 +28,10 @@ DEFAULTS = { "network": { "host": "127.0.0.1", }, + "diarization": { + "enabled": False, + "hf_token": "", + }, "pid_file": os.path.expanduser("~/.local/run/tueit-transcriber.pid"), } @@ -63,4 +67,5 @@ def _write_defaults(): f.write('[whisper]\nmodel = "large-v3"\nlanguage = "de"\ndevice = "auto"\nbase_url = ""\n\n') f.write('[audio]\ndevice = ""\n\n') f.write('[server]\nport = 8765\n\n') - f.write(f'[output]\npath = "{DEFAULTS["output"]["path"]}"\n') + f.write(f'[output]\npath = "{DEFAULTS["output"]["path"]}"\n\n') + f.write('[diarization]\nenabled = false\nhf_token = ""\n\n') diff --git a/tests/test_config.py b/tests/test_config.py index 22fa016..367133f 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -35,3 +35,16 @@ def test_config_has_audio_and_whisper_base_url(): assert "audio" in cfg assert cfg["audio"]["device"] == "" assert cfg["whisper"]["base_url"] == "" + + +def test_config_has_diarization_defaults(): + from unittest.mock import patch + import tempfile, os + with tempfile.TemporaryDirectory() as tmpdir: + cfg_path = os.path.join(tmpdir, "config.toml") + with patch("config.CONFIG_PATH", cfg_path): + import config + cfg = config.load() + assert "diarization" in cfg + assert cfg["diarization"]["enabled"] is False + assert cfg["diarization"]["hf_token"] == ""