Skip to content

Let create_draft set the timeline frame rate (fps) - #88

Open
a5768549 wants to merge 1 commit into
sun-guannan:mainfrom
a5768549:feat/create-draft-fps
Open

a5768549 wants to merge 1 commit into
sun-guannan:mainfrom
a5768549:feat/create-draft-fps

Conversation

@a5768549

Copy link
Copy Markdown

Summary

create_draft always produced a 30 fps timeline: pyJianYingDraft.Script_file already accepts an fps argument (default 30), but create_draft never passed one, so there was no way to make a 24/25/50/60 fps draft through the HTTP API or the MCP server.

This adds an optional fps parameter, defaulting to 30, so existing callers behave exactly as before:

  • create_draft(width, height, fps=30) / get_or_create_draft(..., fps=30) → Script_file(width, height, fps=fps)
  • HTTP POST /create_draft reads fps from the body
  • MCP create_draft tool schema gains fps (integer, default 30, minimum 1)
  • The tool tables in MCP_Documentation_English.md / MCP_文档_中文.md list the new parameter

get_or_create_draft only uses fps when it creates a new draft; an existing draft from the cache is returned unchanged.

Testing

Ran locally on Windows, Python 3.12, against 0596f17:

  • create_draft(width=1920, height=1080, fps=60) → script.fps == 60, and the serialized draft (script.dumps()) contains "fps": 60
  • create_draft() → fps == 30 (default unchanged)
  • get_or_create_draft(fps=25) creates a 25 fps draft; calling it again with that draft_id and fps=60 returns the same cached draft, still 25 fps
  • Flask test client: POST /create_draft {"width":1280,"height":720,"fps":24} → cached draft has fps == 24; POST /create_draft {} → 30
  • mcp_server.execute_tool("create_draft", {"fps": 50}) → success, cached draft has fps == 50

pyJianYingDraft's Script_file already takes an fps argument (default 30),
but create_draft never passed one, so every draft was fixed at 30 fps.
Accept an optional fps on create_draft / get_or_create_draft, the HTTP
/create_draft route and the MCP create_draft tool. The default stays 30,
so existing callers are unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant