Skip to content

Fix repeat mode resetting to off when switching tracks#4357

Open
bharatvansh wants to merge 1 commit intopear-devs:masterfrom
bharatvansh:fix/repeat-mode-restore-on-track-change
Open

Fix repeat mode resetting to off when switching tracks#4357
bharatvansh wants to merge 1 commit intopear-devs:masterfrom
bharatvansh:fix/repeat-mode-restore-on-track-change

Conversation

@bharatvansh
Copy link
Contributor

Summary

This fixes a YouTube Music behavior where repeat mode was getting reset to Repeat Off whenever switching tracks.

The renderer now remembers the user-selected repeat mode (ALL/ONE) and restores it after track data loads if YouTube resets it to NONE.

Why

I was facing this issue locally: each track switch could reset repeat to off, which broke expected playback behavior. This should improve experience for all users who rely on repeat mode.

What changed

  • Added repeat-mode state tracking in src/renderer.ts.
  • Captured repeat-mode changes from UI and IPC (peard:switch-repeat).
  • On videodatachange (dataloaded), restore preferred repeat mode if it was reset.
  • Reused a typed repeat controller helper to avoid repeated DOM queries.

Validation

  • pnpm build (passes)
  • ⚠️ pnpm lint fails due existing repository-wide issues unrelated to this change
  • ⚠️ pnpm typecheck fails due existing repository-wide issues unrelated to this change
  • ⚠️ pnpm test has 1 failing Playwright smoke test (tests/index.test.js) timing out in this environment; other tests pass

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.

1 participant