diff --git a/syncplay/client.py b/syncplay/client.py index 7243abf..0a6f5c2 100644 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -209,7 +209,7 @@ class SyncplayClient(object): self._lastGlobalUpdate = time.time() if (doSeek): madeChangeOnPlayer = self._serverSeeked(position, setBy) - if (diff > constants.REWIND_THRESHOLD and not doSeek): + if (diff > constants.REWIND_THRESHOLD and not doSeek and not self._config['rewindOnDesync'] == False): madeChangeOnPlayer = self._rewindPlayerDueToTimeDifference(position, setBy) if (self._player.speedSupported and not doSeek and not paused and not self._config['slowOnDesync'] == False): madeChangeOnPlayer = self._slowDownToCoverTimeDifference(diff, setBy) diff --git a/syncplay/ui/ConfigurationGetter.py b/syncplay/ui/ConfigurationGetter.py index 8ba842f..ae95be9 100644 --- a/syncplay/ui/ConfigurationGetter.py +++ b/syncplay/ui/ConfigurationGetter.py @@ -34,6 +34,7 @@ class ConfigurationGetter(object): "playerArgs": [], "playerClass": None, "slowOnDesync": True, + "rewindOnDesync": True, "malUsername": "", "malPassword": "" } @@ -55,12 +56,13 @@ class ConfigurationGetter(object): "forceGuiPrompt", "noGui", "noStore", - "slowOnDesync" + "slowOnDesync", + "rewindOnDesync" ] self._iniStructure = { "server_data": ["host", "port", "password"], - "client_settings": ["name", "room", "playerPath", "slowOnDesync", "forceGuiPrompt"], + "client_settings": ["name", "room", "playerPath", "slowOnDesync", "rewindOnDesync", "forceGuiPrompt"], "mal": ["malPassword", "malUsername"] } diff --git a/syncplay/ui/GuiConfiguration.py b/syncplay/ui/GuiConfiguration.py index 12ddcf1..4f0df5d 100644 --- a/syncplay/ui/GuiConfiguration.py +++ b/syncplay/ui/GuiConfiguration.py @@ -169,6 +169,10 @@ class ConfigDialog(QtGui.QDialog): self.config['slowOnDesync'] = True else: self.config['slowOnDesync'] = False + if self.rewindCheckbox.isChecked() == True: + self.config['rewindOnDesync'] = True + else: + self.config['rewindOnDesync'] = False self.config['malUsername'] = self.malusernameTextbox.text() if self.malSettingsGroup.isChecked(): self.config['malPassword'] = self.malpasswordTextbox.text() @@ -261,6 +265,7 @@ class ConfigDialog(QtGui.QDialog): self.mediabrowseButton = QtGui.QPushButton(QtGui.QIcon(resourcespath + 'folder_explore.png'),"Browse") self.mediabrowseButton.clicked.connect(self.browseMediapath) self.slowdownCheckbox = QCheckBox("Slow down on desync") + self.rewindCheckbox = QCheckBox("Rewind on desync") self.mediaplayerSettingsLayout = QtGui.QGridLayout() self.mediaplayerSettingsLayout.addWidget(self.executablepathLabel, 0, 0) self.mediaplayerSettingsLayout.addWidget(self.executablepathCombobox , 0, 1) @@ -269,9 +274,12 @@ class ConfigDialog(QtGui.QDialog): self.mediaplayerSettingsLayout.addWidget(self.mediapathTextbox , 1, 1) self.mediaplayerSettingsLayout.addWidget(self.mediabrowseButton , 1, 2) self.mediaplayerSettingsLayout.addWidget(self.slowdownCheckbox, 2, 0) + self.mediaplayerSettingsLayout.addWidget(self.rewindCheckbox, 3, 0) self.mediaplayerSettingsGroup.setLayout(self.mediaplayerSettingsLayout) if config['slowOnDesync'] == True: self.slowdownCheckbox.setChecked(True) + if config['rewindOnDesync'] == True: + self.rewindCheckbox.setChecked(True) self.malSettingsGroup = QtGui.QGroupBox("Enable MyAnimeList updater (EXPERIMENTAL)") self.malSettingsGroup.setCheckable(True)