From e2eac8798cf75b0c60be24580b636a4e5091d4a8 Mon Sep 17 00:00:00 2001 From: puke <1129090915@qq.com> Date: Thu, 20 Nov 2025 14:28:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96api=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/routers/frame.py | 7 +++---- api/routers/resources.py | 4 ++-- api/schemas/frame.py | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/api/routers/frame.py b/api/routers/frame.py index 4421e1b..e345f87 100644 --- a/api/routers/frame.py +++ b/api/routers/frame.py @@ -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( diff --git a/api/routers/resources.py b/api/routers/resources.py index ff91c28..f247874 100644 --- a/api/routers/resources.py +++ b/api/routers/resources.py @@ -100,8 +100,8 @@ async def list_image_workflows(pixelle_video: PixelleVideoDep): ``` """ try: - # Get all workflows from image service - all_workflows = pixelle_video.image.list_workflows() + # Get all workflows from media service (image generation is handled by media service) + all_workflows = pixelle_video.media.list_workflows() # Filter to image workflows only (filename starts with "image_") image_workflows = [ diff --git a/api/schemas/frame.py b/api/schemas/frame.py index f8b2c3c..d4f72d6 100644 --- a/api/schemas/frame.py +++ b/api/schemas/frame.py @@ -26,7 +26,7 @@ class FrameRenderRequest(BaseModel): ) title: Optional[str] = Field(None, description="Frame title (optional)") text: str = Field(..., description="Frame text content") - image: str = Field(..., description="Image path or URL") + image: Optional[str] = Field(None, description="Image path or URL (optional)") class Config: json_schema_extra = {