fix: inline validate(), fix voice_acting.py → tts_generate.py ref

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
AMEfremova 2026-04-29 11:42:45 +03:00
parent 10a7934b35
commit f58ae99cc3

View file

@ -12,7 +12,11 @@ import _env as _ # loads .env from repo root
from trend import expand_trend, load_trends, match_trend
from trend_catalog import looks_like_trend_request
from validate import validate
def validate(result: dict) -> tuple[list, list]:
errors, warnings = [], []
if not result.get("scenes"):
errors.append("no scenes in scenario")
return errors, warnings
# Fix Windows console encoding (cp1251 can't handle ₽, emoji, etc.)
if sys.stdout.encoding and sys.stdout.encoding.lower() not in ('utf-8', 'utf8'):
@ -849,11 +853,11 @@ def main():
# Run voice synthesis if requested
if args.voice:
voice_script = os.path.join(
os.path.dirname(__file__), "..", "..", "voice", "voice_acting.py"
os.path.dirname(__file__), "..", "..", "voice", "tts_generate.py"
)
voice_script = os.path.normpath(voice_script)
if not os.path.exists(voice_script):
print(f"Error: voice_acting.py not found at {voice_script}", file=sys.stderr)
print(f"Error: tts_generate.py not found at {voice_script}", file=sys.stderr)
sys.exit(1)
segments_dir = args.voice_out or os.path.join(