Skip to content

Commit

Permalink
Fix PlayerMPD.rewind to start with the first song
Browse files Browse the repository at this point in the history
rewind() is documented to jump to the first song of the playlist.
Instead, it jumped to the second song as SONGPOS in
MPDClient.play(SONGPOS) is zero-indexed [1], so mpd.play(1) started
the second song.

[1] https://mpd.readthedocs.io/en/latest/protocol.html#the-queue
"The position is a 0-based index"

Related: #2294
  • Loading branch information
hoffie committed Apr 6, 2024
1 parent 27b23cb commit f174a7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/jukebox/components/playermpd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def rewind(self):
Note: Will not re-read folder config, but leave settings untouched"""
logger.debug("Rewind")
with self.mpd_lock:
self.mpd_client.play(1)
self.mpd_client.play(0)

@plugs.tag
def replay(self):
Expand Down

0 comments on commit f174a7e

Please sign in to comment.