Skip to content

Remove duplicated inline body from Novel2MoviePipeline.__call__#65

Open
fviolette26 wants to merge 1 commit into
HKUDS:mainfrom
fviolette26:fix/novel2movie-dedupe-call
Open

Remove duplicated inline body from Novel2MoviePipeline.__call__#65
fviolette26 wants to merge 1 commit into
HKUDS:mainfrom
fviolette26:fix/novel2movie-dedupe-call

Conversation

@fviolette26

Copy link
Copy Markdown
Contributor

Problem

Novel2MoviePipeline.__call__ re-implements the entire pipeline inline (~510 lines), but the same logic already lives in the plan_text_artifacts and render_video_artifacts methods on the same class. As a result:

  • plan_text_artifacts and render_video_artifacts are dead code — defined but never reached.
  • The pipeline logic exists in two copies that can silently drift apart.

Fix

Make __call__ delegate to the existing methods:

async def __call__(self, novel_text: str, style: str):
    print("🎬 Novel to Movie Pipeline Started".center(80, "="))
    await self.plan_text_artifacts(novel_text)
    return await self.render_video_artifacts(style=style)

Behavior unchanged

The extracted methods carry the identical logic, including the unbounded-extraction safety caps (_ensure_extraction_cap, MAX_EXTRACTED_EVENTS, MAX_SCENES_PER_EVENT). Net diff: +2 / −512, no behavior change. Full test suite passes (152 passed, 11 subtests).

🤖 Generated with Claude Code

`__call__` re-implemented the entire pipeline inline (~510 lines) even
though the same logic already lives in the `plan_text_artifacts` and
`render_video_artifacts` methods. Those two methods were therefore dead
code — defined but never reached — and the two copies could silently
drift apart over time.

Make `__call__` delegate to the methods, matching the structure the rest
of the class already assumes. Behavior is unchanged: the extracted
methods carry the same logic, including the unbounded-extraction safety
caps (`_ensure_extraction_cap`, `MAX_EXTRACTED_EVENTS`,
`MAX_SCENES_PER_EVENT`). Net: -512 lines, no behavior change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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