优化api接口逻辑

This commit is contained in:
puke
2025-11-20 14:28:23 +08:00
parent 68e3eedcd2
commit e2eac8798c
3 changed files with 6 additions and 7 deletions

View File

@@ -56,15 +56,14 @@ async def render_frame(
try:
logger.info(f"Frame render request: template={request.template}")
# Resolve template path (handles both "default.html" and "1080x1920/default.html")
# Resolve template path (returns absolute path with "templates/" or "data/templates/" prefix)
template_path = resolve_template_path(request.template)
full_template_path = f"templates/{template_path}"
# Parse template size
width, height = parse_template_size(full_template_path)
width, height = parse_template_size(template_path)
# Create HTML frame generator
generator = HTMLFrameGenerator(full_template_path)
generator = HTMLFrameGenerator(template_path)
# Generate frame
frame_path = await generator.generate_frame(