Grid split mode: one compilation carved across the cells #19
Loading…
Reference in a new issue
No description provided.
Delete branch "f/grid-split"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Grid layouts gain a cell-content choice: independent random per cell (existing) or one compilation split into consecutive duration-balanced segments playing simultaneously, so a 40 minute sequence becomes roughly 10 minutes of 4-up. Selection and track creation were factored into shared helpers and the partition logic has unit tests.
🤖 Claude AI Code Review
Summary
Adds a "split single compilation across grid cells" mode with a duration-balanced contiguous partition helper, shared selection/track-creation helpers, and unit tests.
Code Quality ⭐⭐⭐⭐☆
Good refactor into reusable helpers with solid edge-case test coverage (lopsided durations, fewer clips than cells).
Issues
🟡 ShotcutService.cs —
SetRenderRangeToPlaylistDurationnot applied in split/grid mode.GenerateRandomPlaylistcalls it, butGenerateGridCompilationnever sets the render range for either mode. If this was already the case pre-PR it's out of scope, but split mode's total runtime is intentionally shorter (~1/N), so the render range logic (which the description emphasizes) is worth confirming behaves correctly. Verify the exported clip length matches the longest cell.🟢 SplitEvenlyByDuration — partition target uses
targetPerPart * (part + 1)against cumulativeaccumulated, which is correct, but zero-duration entries (allDuration == 0) would collapse everything into the first chunk becauseaccumulated >= 0is never triggered by non-empty accumulation until a nonzero clip appears. TheremainingEntries <= partsAfterCurrentfallback still guarantees non-empty tail chunks, so no empty-cell bug — just noting balance degrades to nothing meaningful for zero-duration inputs. Not a blocker.The partition logic is sound and well-tested. Just confirm the render/export range is correct for grid modes (particularly split, where runtime is intentionally reduced) — but that appears to be pre-existing behavior outside this PR's scope.
📊 Tokens: 7484 input + 608 output | 💰 Cost: ~$0.0526
Generated by Claude Opus 4.8 via Gitea Actions