Skip to content

Back goes to the previous song, or asks the room to - #58

Merged
madeofpendletonwool merged 1 commit into
mainfrom
back-to-previous-song
Oct 8, 2026
Merged

madeofpendletonwool merged 1 commit into
mainfrom
back-to-previous-song

Conversation

@madeofpendletonwool

Copy link
Copy Markdown
Owner

Back used to only restart the song, so there was no way to hear the last one again.

What back does now

  • After the first 3 seconds of a song, back restarts it, as before.
  • Within the first 3 seconds (for example, pressing back twice), it plays the previous song again. The phone lock-screen control works the same way.
  • The song that was interrupted goes to the front of the queue and plays next, from the start. Its unfinished play is deleted, so it doesn't count as a skip in stats or in the DJ's picks, and its owner doesn't lose their turn. Going back several times puts each interrupted song back, the most recent first.
  • Going back ends the current song, so it uses the skip permission. In a room that votes on skips, anyone except the owner starts a vote, which reuses the "play now" vote ("bob wants to go back to Song", with a Go back button). The request lapses if the song changes. Guests can't start a vote to go back.

Changes

  • API: new previous playback action. PlayNowVote gains back and item, since the song isn't in the queue.
  • Migration 00024: adds queue_items.resume_at. Songs with it set play ahead of the fair order. Moving or removing a song clears it.
  • Engine: previousCommand, previous and goBack. Play-now votes can now settle as a go-back.
  • Web: back-button logic in use-room-controls, the lock-screen handler in speaker.ts, and the vote prompt in play-now-request.
  • Docs: the playback-engine design doc (ADR 0003) and player-mode.md.

Testing

  • New tests: TestPrevious and TestPreviousVote.
  • go test -race ./..., golangci-lint, and the web typecheck, lint and tests all pass.
  • Not yet tried by hand in a real room.

🤖 Generated with Claude Code

Back still restarts the song; pressed in its first 3 seconds it now plays
the song before again. The interrupted song goes back to the front of the
queue to play next from the start, and its unfinished play is forgotten so
it isn't a skip. It takes the skip permission; in a room that votes on
skips it asks the room through the play-now vote.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@madeofpendletonwool
madeofpendletonwool merged commit f12ca68 into main Oct 8, 2026
5 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.

1 participant