Skip to content

fix(loopyLoop): loop between markers when repeat-one is active#3833

Merged
rxri merged 2 commits intospicetify:mainfrom
3xyy:loopyloop-repeat-one-fix
May 1, 2026
Merged

fix(loopyLoop): loop between markers when repeat-one is active#3833
rxri merged 2 commits intospicetify:mainfrom
3xyy:loopyloop-repeat-one-fix

Conversation

@3xyy
Copy link
Copy Markdown
Contributor

@3xyy 3xyy commented Apr 24, 2026

Fixes not looping on repeat one.

#3771 (comment)

Summary by CodeRabbit

  • Bug Fixes
    • Loop behavior now respects Spotify repeat mode: with repeat-one enabled, tracks loop back to the configured start position rather than advancing.
    • Prevents rapid/duplicate seeks when looping (seek rate is managed and reset on track change) to provide smoother replay behavior.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 297c7796-011f-4220-80cc-81140538cc31

📥 Commits

Reviewing files that changed from the base of the PR and between b347bd6 and c1ebf94.

📒 Files selected for processing (1)
  • Extensions/loopyLoop.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • Extensions/loopyLoop.js

📝 Walkthrough

Walkthrough

Modified loopyLoop's onprogress handler to respect Spotify repeat mode: when playback reaches the configured end marker, it either seeks back to the loop start for repeat-one, or advances to the next track for other repeat modes. A new state tracks recent repeat-one seeks and resets on song change.

Changes

Cohort / File(s) Summary
Loopy Loop Repeat Mode Handling
Extensions/loopyLoop.js
onprogress handler now calls Spicetify.Player.getRepeat() at the end marker. For repeat-one (=== 2) it throttles and seeks to start ?? 0 using lastEndLoopSeek; otherwise it preserves previous behavior by setting seekStartPendingUri and calling Spicetify.Player.next(). lastEndLoopSeek is reset on songchange.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • rxri

Poem

🐰 I hop where loops meet song's end,
I check the repeat and softly bend,
If it says "one", I jump to start,
Else onward hops the playlist heart,
— The Looping Rabbit 🎶

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main fix: enabling looping between markers when repeat-one mode is active, which directly matches the changeset's core functionality.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Extensions/loopyLoop.js`:
- Around line 301-314: The shared 2s throttle variable lastNextCall is blocking
short repeat-one loops; create and use a separate, shorter timestamp throttle
(e.g., lastEndLoopSeek) for the repeat-one seek path inside the block that calls
Spicetify.Player.seek(start ?? 0) so seeks are only gated by ~500ms (matching
lastStartEnforce) while preserving the existing 2s throttle for the
Spicetify.Player.next() branch that uses lastNextCall and seekStartPendingUri;
also reset lastEndLoopSeek in the songchange handler alongside the other timers
so it doesn't persist across tracks.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: fc70a277-bf7a-4ff9-8010-d8ed6e36a827

📥 Commits

Reviewing files that changed from the base of the PR and between 035d194 and b347bd6.

📒 Files selected for processing (1)
  • Extensions/loopyLoop.js

Comment thread Extensions/loopyLoop.js
@rxri rxri merged commit a1447c8 into spicetify:main May 1, 2026
7 checks passed
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.

2 participants