fix: handle numeric FILE in TTS/ANNOUNCEMENTS (YAML parses as int)

pull/4/head
Rodrigo Pérez 6 months ago
parent a18248dc1e
commit a4f888f227

@ -282,7 +282,7 @@ class VoiceUseCases:
if self._call_later:
self._call_later(3.0 + ann_idx * 0.5, self.scheduled_announcement, ann_idx, _retry + 1)
return
_file = (item.get("FILE") or "").strip()
_file = str(item.get("FILE") or "").strip()
_tg = int(item.get("TG", 0))
_lang = item.get("LANGUAGE", "en_GB")
if not _file or not _tg:
@ -351,7 +351,7 @@ class VoiceUseCases:
if self._call_later:
self._call_later(3.0 + tts_idx * 0.5, self.scheduled_tts_announcement, tts_idx, _retry + 1)
return
_file = (item.get("FILE") or "").strip()
_file = str(item.get("FILE") or "").strip()
_tg = int(item.get("TG", 0))
_lang = item.get("LANGUAGE", "en_GB")
self._tts_running[tts_idx] = True

@ -312,7 +312,7 @@ def ensure_tts_ambe(config: dict[str, Any], item: dict[str, Any], audio_path: st
"""Ensure .ambe exists for TTS item; create from .txt if needed. Returns path or None."""
if not item.get("ENABLED", False):
return None
_file = (item.get("FILE") or "").strip()
_file = str(item.get("FILE") or "").strip()
_lang = item.get("LANGUAGE", "en_GB")
if not _file:
return None

Loading…
Cancel
Save

Powered by TurnKey Linux.