Grid split mode: one compilation carved across the cells #19

Merged
cheapnud merged 2 commits from f/grid-split into master 2026-08-20 20:32:53 +00:00
Owner

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.

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.
grid split mode: carve one compilation evenly across the cells
All checks were successful
Claude PR Review / AI Code Review (pull_request) Successful in 14s
Build & Test / Build and Test (pull_request) Successful in 29s
26dbbd667a

🤖 Claude AI Code Review

  1. 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.

  2. Code Quality
    Good refactor into reusable helpers with solid edge-case test coverage (lopsided durations, fewer clips than cells).

  3. Issues

🟡 ShotcutService.cs — SetRenderRangeToPlaylistDuration not applied in split/grid mode. GenerateRandomPlaylist calls it, but GenerateGridCompilation never 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 cumulative accumulated, which is correct, but zero-duration entries (all Duration == 0) would collapse everything into the first chunk because accumulated >= 0 is never triggered by non-empty accumulation until a nonzero clip appears. The remainingEntries <= partsAfterCurrent fallback 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.

  1. Verdict: APPROVE

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

## 🤖 Claude AI Code Review 1. **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. 2. **Code Quality** ⭐⭐⭐⭐☆ Good refactor into reusable helpers with solid edge-case test coverage (lopsided durations, fewer clips than cells). 3. **Issues** 🟡 ShotcutService.cs — `SetRenderRangeToPlaylistDuration` not applied in split/grid mode. `GenerateRandomPlaylist` calls it, but `GenerateGridCompilation` never 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 cumulative `accumulated`, which is correct, but zero-duration entries (all `Duration == 0`) would collapse everything into the first chunk because `accumulated >= 0` is never triggered by non-empty accumulation until a nonzero clip appears. The `remainingEntries <= partsAfterCurrent` fallback 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. 4. **Verdict**: **APPROVE** 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*
split mode never leaves empty grid cells; skip unfillable cells when clips are scarce
All checks were successful
Claude PR Review / AI Code Review (pull_request) Successful in 16s
Build & Test / Build and Test (pull_request) Successful in 24s
799242cd99
cheapnud merged commit 8985297c18 into master 2026-08-20 20:32:53 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cheapnud/CheapShotcutRandomizer!19
No description provided.