Skip to content

Commit

Permalink
MPC: Only reset position if file is playing (#663)
Browse files Browse the repository at this point in the history
Avoids MpcHcApi.PlayerNotReadyException if you add media to empty playlist.
  • Loading branch information
Et0h authored Feb 7, 2024
1 parent c670acb commit 888bb53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion syncplay/players/mpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def initPlayer(self, filePath):

def openFile(self, filePath, resetPosition=False):
self._mpcApi.openFile(filePath)
if resetPosition:
if resetPosition and self._mpcApi.filePlaying:
self.setPosition(0, resetPosition=True)

def displayMessage(
Expand Down

0 comments on commit 888bb53

Please sign in to comment.