fix(venue): fly in once per set, not before every gig song#978
Conversation
Tester, mid-gig: "the second song in the gig started when the first one ended. But it showed the flyover intro again." The flyover is arriving at the venue, and you arrive once. #968 stopped it replaying on an arrangement SWITCH (same filename), but a gig's song 2 is a genuinely different file, so it took the full-teardown path and played the arrival flyover again — the camera flew in from the back of the room before every track of the set. The play queue now answers isContinuation(): false for the first song of a set (or a standalone play — an arrival), true for song 2..N. onSongLoaded carries the room over to the new song's loop on a continuation, and only a real arrival plays the intro. Verified on the built AppImage: isContinuation goes false (song 1) -> true (song 2) across an advance, and song 2 no longer flies in. Also confirmed NOT a bug, same session: "didn't show the author for the second song." The credits card shows on a queue advance whenever the song carries authors — reproduced with a song that has them as the advanced-to track. The tester's song 2 simply had no `authors:` metadata (most auto-converted feedpaks don't). No code change. Tests: isContinuation across start/advance/clear, and that onSongLoaded gates the flyover on the continuation check. Both fail on pre-fix source. JS 1214/1214.
📝 WalkthroughWalkthroughThe play queue now exposes whether the current track follows the first queued track. Venue crowd loading uses this signal to skip repeated arrival flyovers during a set while preserving standalone intro behavior and fallback handling. ChangesSet continuation flow
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant SongLoader
participant PlayQueue
participant VenueCrowd
SongLoader->>PlayQueue: isContinuation()
PlayQueue-->>SongLoader: continuation status
alt Continuation
SongLoader->>VenueCrowd: showLoop(machine.current, FADE_MS)
else Standalone arrival
SongLoader->>VenueCrowd: playIntro()
VenueCrowd-->>SongLoader: intro failure
SongLoader->>VenueCrowd: showLoop(machine.current, FADE_MS)
end
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/js/venue_scope.test.js (1)
120-138: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider testing via execution instead of brace-matching the source string.
This test slices
onSongLoaded's body by manual brace counting and regexes for symbol names, which is fragile to formatting/comment changes.play_queue_peek.test.jsalready has a sandboxed-execution harness forapp.js; a similar approach here (stub_isSetContinuation/playIntrovia spies and assert call order) would be more robust to refactors.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/js/venue_scope.test.js` around lines 120 - 138, The test around onSongLoaded should execute the function in a sandbox rather than extracting its source with manual brace counting and regex checks. Reuse the sandboxed harness pattern from play_queue_peek.test.js, stub _isSetContinuation and playIntro with spies, and assert that a continuation skips the intro while a real arrival still invokes it.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/js/venue_scope.test.js`:
- Around line 120-138: The test around onSongLoaded should execute the function
in a sandbox rather than extracting its source with manual brace counting and
regex checks. Reuse the sandboxed harness pattern from play_queue_peek.test.js,
stub _isSetContinuation and playIntro with spies, and assert that a continuation
skips the intro while a real arrival still invokes it.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 2853a3d1-a190-4f2d-97a7-949bc6d40880
📒 Files selected for processing (4)
static/app.jsstatic/v3/venue-crowd.jstests/js/play_queue_peek.test.jstests/js/venue_scope.test.js
Tester, mid-gig: "the second song in the gig started when the first one ended. But it showed the flyover intro again."
The flyover is arriving at the venue, and you arrive once. #968 stopped it replaying on an arrangement switch (same filename), but a gig's song 2 is a genuinely different file, so it took the full-teardown path and flew the camera in from the back of the room before every track of the set.
The play queue now answers
isContinuation()— false for the first song of a set (or a standalone play: an arrival), true for song 2..N.onSongLoadedcarries the room over to the new song's loop on a continuation, and only a real arrival plays the intro.Verified on the built AppImage:
isContinuationgoes false (song 1) → true (song 2) across an advance, and song 2 no longer flies in.Also from the same report — NOT a bug
"I think it didn't show the author for the second song." The credits card does show on a queue advance whenever the song carries authors — reproduced with a song that has them as the advanced-to track. The tester's song 2 simply had no
authors:metadata (most auto-converted feedpaks don't). No code change.Tests:
isContinuationacross start/advance/clear, and thatonSongLoadedgates the flyover on the continuation check. Both fail on pre-fix source. JS 1214/1214.Summary by CodeRabbit
New Features
Bug Fixes
Tests