feat: editorial template static image rendering#136
feat: editorial template static image rendering#136recoup-coding-agent wants to merge 1 commit intomainfrom
Conversation
Editorial content now renders both a video and a static image (editorial base with playlist cover overlays). The static image is passed through the callback chain as `staticImageUrl` alongside the video. - New `buildStaticImageArgs` — ffmpeg args for single-frame image render - New `renderStaticImage` — downloads base + overlays, runs ffmpeg, uploads PNG - `createContentTask` renders static image when template uses overlay - `pollContentRuns` extracts `imageUrl` from task output - 12 new tests (all green) Co-Authored-By: Paperclip <noreply@paperclip.ing>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 26 minutes and 33 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
1 issue found across 9 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/content/renderStaticImage.ts">
<violation number="1" location="src/content/renderStaticImage.ts:61">
P2: Temp directory is never removed. The `finally` block unlinks individual files but leaves the `tempDir` directory on disk. Replace the per-file cleanup with a single recursive `rm` call on the directory.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
|
|
||
| return { imageUrl: result.url, mimeType: result.mimeType, sizeBytes: result.sizeBytes }; | ||
| } finally { | ||
| const cleanupPaths = [imagePath, outputPath, ...overlayPaths]; |
There was a problem hiding this comment.
P2: Temp directory is never removed. The finally block unlinks individual files but leaves the tempDir directory on disk. Replace the per-file cleanup with a single recursive rm call on the directory.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/content/renderStaticImage.ts, line 61:
<comment>Temp directory is never removed. The `finally` block unlinks individual files but leaves the `tempDir` directory on disk. Replace the per-file cleanup with a single recursive `rm` call on the directory.</comment>
<file context>
@@ -0,0 +1,64 @@
+
+ return { imageUrl: result.url, mimeType: result.mimeType, sizeBytes: result.sizeBytes };
+ } finally {
+ const cleanupPaths = [imagePath, outputPath, ...overlayPaths];
+ await Promise.all(cleanupPaths.map(p => unlink(p).catch(() => undefined)));
+ }
</file context>
Summary
renderStaticImagefunction composites base image + overlay images via ffmpeg, uploads to fal.ai storagecreateContentTaskgenerates static image when template uses overlay, returnsstaticImageUrlin outputpollContentRunsextractsimageUrlfrom task results and forwards through callback chainTest plan
buildStaticImageArgs(pure ffmpeg arg builder)renderStaticImage(mocked download/ffmpeg/upload)pollContentRuns(updated to include imageUrl extraction)🤖 Generated with Claude Code
Summary by cubic
Adds static image rendering to the editorial pipeline so each run outputs both a video and a PNG with playlist cover overlays. Implements REC-65 and exposes the PNG as imageUrl in poll results.
renderStaticImageto compose base + overlay images via ffmpeg, upload to fal.ai, and return URL/size.buildStaticImageArgsfor single-frame crop to 9:16 (720×1280) and stacked overlays.createContentTaskto render the PNG when overlays are used and includestaticImageUrlin task output.pollContentRunsto mapstaticImageUrltoimageUrlfor consumers.Written for commit f645399. Summary will update on new commits.