mirror of
https://github.com/Syncplay/syncplay
synced 2025-03-11 06:07:53 +00:00
Revert any changes to tri logic
This commit is contained in:
parent
e3ea08519f
commit
d59afb8f2f
@ -317,7 +317,7 @@ class SyncplayClient(object):
|
||||
self.setPosition(self.getGlobalPosition())
|
||||
self._player.setPaused(True)
|
||||
madeChangeOnPlayer = True
|
||||
if (self.lastLeftTime < time.time() - constants.OSD_DURATION) or hideFromOSD:
|
||||
if (self.lastLeftTime < time.time() - constants.OSD_DURATION) or hideFromOSD == True:
|
||||
self.ui.showMessage(getMessage("pause-notification").format(setBy), hideFromOSD)
|
||||
else:
|
||||
self.ui.showMessage(getMessage("left-paused-notification").format(self.lastLeftUser, setBy), hideFromOSD)
|
||||
@ -364,9 +364,9 @@ class SyncplayClient(object):
|
||||
self._lastGlobalUpdate = time.time()
|
||||
if doSeek:
|
||||
madeChangeOnPlayer = self._serverSeeked(position, setBy)
|
||||
if diff > self._config['rewindThreshold'] and not doSeek and self._config['rewindOnDesync']:
|
||||
if diff > self._config['rewindThreshold'] and not doSeek and not self._config['rewindOnDesync'] == False:
|
||||
madeChangeOnPlayer = self._rewindPlayerDueToTimeDifference(position, setBy)
|
||||
if self._config['fastforwardOnDesync'] and (not self.userlist.currentUser.canControl() or self._config['dontSlowDownWithMe']):
|
||||
if self._config['fastforwardOnDesync'] and (self.userlist.currentUser.canControl() == False or self._config['dontSlowDownWithMe'] == True):
|
||||
if diff < (constants.FASTFORWARD_BEHIND_THRESHOLD * -1) and not doSeek:
|
||||
if self.behindFirstDetected is None:
|
||||
self.behindFirstDetected = time.time()
|
||||
@ -378,11 +378,11 @@ class SyncplayClient(object):
|
||||
self.behindFirstDetected = time.time() + constants.FASTFORWARD_RESET_THRESHOLD
|
||||
else:
|
||||
self.behindFirstDetected = None
|
||||
if self._player.speedSupported and not doSeek and not paused and self._config['slowOnDesync']:
|
||||
if self._player.speedSupported and not doSeek and not paused and not self._config['slowOnDesync'] == False:
|
||||
madeChangeOnPlayer = self._slowDownToCoverTimeDifference(diff, setBy)
|
||||
if not paused and pauseChanged:
|
||||
if paused == False and pauseChanged:
|
||||
madeChangeOnPlayer = self._serverUnpaused(setBy)
|
||||
elif paused and pauseChanged:
|
||||
elif paused == True and pauseChanged:
|
||||
madeChangeOnPlayer = self._serverPaused(setBy)
|
||||
return madeChangeOnPlayer
|
||||
|
||||
@ -774,7 +774,7 @@ class SyncplayClient(object):
|
||||
from syncplay.ui.ConfigurationGetter import ConfigurationGetter
|
||||
ConfigurationGetter().setConfigOption("sharedPlaylistEnabled", newState)
|
||||
self._config["sharedPlaylistEnabled"] = newState
|
||||
if not oldState and newState:
|
||||
if oldState == False and newState == True:
|
||||
self.playlist.loadCurrentPlaylistIndex()
|
||||
|
||||
def changeAutoplayState(self, newState):
|
||||
@ -785,7 +785,7 @@ class SyncplayClient(object):
|
||||
oldAutoplayConditionsMet = self.autoplayConditionsMet()
|
||||
self.autoPlayThreshold = newThreshold
|
||||
newAutoplayConditionsMet = self.autoplayConditionsMet()
|
||||
if not oldAutoplayConditionsMet and newAutoplayConditionsMet:
|
||||
if oldAutoplayConditionsMet == False and newAutoplayConditionsMet == True:
|
||||
self.autoplayCheck()
|
||||
|
||||
def autoplayCheck(self):
|
||||
@ -1158,7 +1158,7 @@ class SyncplayUserlist(object):
|
||||
showOnOSD = constants.SHOW_OSD_WARNINGS
|
||||
else:
|
||||
showOnOSD = constants.SHOW_DIFFERENT_ROOM_OSD
|
||||
if constants.SHOW_NONCONTROLLER_OSD == False and not self.canControl(username):
|
||||
if constants.SHOW_NONCONTROLLER_OSD == False and self.canControl(username) == False:
|
||||
showOnOSD = False
|
||||
hideFromOSD = not showOnOSD
|
||||
if not file_:
|
||||
@ -1275,7 +1275,7 @@ class SyncplayUserlist(object):
|
||||
return False
|
||||
for user in self._users.values():
|
||||
if user.room == self.currentUser.room:
|
||||
if not user.isReadyWithFile() == False:
|
||||
if user.isReadyWithFile() == False:
|
||||
return False
|
||||
elif (
|
||||
requireSameFilenames and
|
||||
|
@ -396,11 +396,11 @@ class MplayerPlayer(BasePlayer):
|
||||
oldState = self.readyToSend
|
||||
self.readyToSend = newReadyState
|
||||
self.lastNotReadyTime = time.time() if newReadyState == False else None
|
||||
if self.readyToSend:
|
||||
if self.readyToSend == True:
|
||||
self.__playerController._client.ui.showDebugMessage("<mpv> Ready to send: True")
|
||||
else:
|
||||
self.__playerController._client.ui.showDebugMessage("<mpv> Ready to send: False")
|
||||
if self.readyToSend and oldState == False:
|
||||
if self.readyToSend == True and oldState == False:
|
||||
self.processSendQueue()
|
||||
|
||||
def checkForReadinessOverride(self):
|
||||
@ -409,7 +409,7 @@ class MplayerPlayer(BasePlayer):
|
||||
|
||||
def sendLine(self, line, notReadyAfterThis=None):
|
||||
self.checkForReadinessOverride()
|
||||
if not self.readyToSend and "print_text ANS_pause" in line:
|
||||
if self.readyToSend == False and "print_text ANS_pause" in line:
|
||||
self.__playerController._client.ui.showDebugMessage("<mpv> Not ready to get status update, so skipping")
|
||||
return
|
||||
try:
|
||||
|
@ -164,7 +164,7 @@ class NewMpvPlayer(OldMpvPlayer):
|
||||
self._listener.sendLine("print_text ""ANS_{}=${{{}}}""".format(property_, propertyID))
|
||||
|
||||
def getCalculatedPosition(self):
|
||||
if not self.fileLoaded:
|
||||
if self.fileLoaded == False:
|
||||
self._client.ui.showDebugMessage(
|
||||
"File not loaded so using GlobalPosition for getCalculatedPosition({})".format(
|
||||
self._client.getGlobalPosition()))
|
||||
@ -266,7 +266,7 @@ class NewMpvPlayer(OldMpvPlayer):
|
||||
self._client.ui.showDebugMessage("Want to set paused to {}".format(self._client.getGlobalPaused()))
|
||||
else:
|
||||
self._client.ui.showDebugMessage("Don't want to set paused to {}".format(self._client.getGlobalPaused()))
|
||||
if not resetPosition:
|
||||
if resetPosition == False:
|
||||
self.setPosition(self._client.getGlobalPosition())
|
||||
else:
|
||||
self._storePosition(0)
|
||||
|
@ -223,7 +223,7 @@ class VlcPlayer(BasePlayer):
|
||||
self._duration = float(value.replace(",", "."))
|
||||
self._durationAsk.set()
|
||||
elif name == "playstate":
|
||||
self._paused = bool(value != 'playing') if (value != "no-input" and not self._filechanged) else self._client.getGlobalPaused()
|
||||
self._paused = bool(value != 'playing') if (value != "no-input" and self._filechanged == False) else self._client.getGlobalPaused()
|
||||
diff = time.time() - self._lastVLCPositionUpdate if self._lastVLCPositionUpdate else 0
|
||||
if (
|
||||
self._paused == False and
|
||||
@ -507,4 +507,4 @@ class VlcPlayer(BasePlayer):
|
||||
try:
|
||||
self.__process.terminate()
|
||||
except: # When VLC is already closed
|
||||
pass
|
||||
pass
|
||||
|
@ -284,7 +284,7 @@ class ConfigurationGetter(object):
|
||||
elif key == "host":
|
||||
self._config["host"], self._config["port"] = self._splitPortAndHost(self._config["host"])
|
||||
hostNotValid = (self._config["host"] == "" or self._config["host"] is None)
|
||||
portNotValid = (not _isPortValid(self._config["port"]))
|
||||
portNotValid = (_isPortValid(self._config["port"]) == False)
|
||||
if hostNotValid:
|
||||
raise InvalidConfigValue(getMessage("no-hostname-config-error"))
|
||||
elif portNotValid:
|
||||
|
@ -887,7 +887,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
|
||||
@needsClient
|
||||
def browseMediapath(self):
|
||||
if self._syncplayClient._player.customOpenDialog:
|
||||
if self._syncplayClient._player.customOpenDialog == True:
|
||||
self._syncplayClient._player.openCustomOpenDialog()
|
||||
return
|
||||
|
||||
@ -916,7 +916,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
|
||||
@needsClient
|
||||
def OpenAddFilesToPlaylistDialog(self):
|
||||
if self._syncplayClient._player.customOpenDialog:
|
||||
if self._syncplayClient._player.customOpenDialog == True:
|
||||
self._syncplayClient._player.openCustomOpenDialog()
|
||||
return
|
||||
|
||||
@ -1659,7 +1659,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
dropfilepath = os.path.abspath(NSURL.URLWithString_(pathString).filePathURL().path())
|
||||
else:
|
||||
dropfilepath = os.path.abspath(str(url.toLocalFile()))
|
||||
if not rewindFile:
|
||||
if rewindFile == False:
|
||||
self._syncplayClient._player.openFile(dropfilepath)
|
||||
else:
|
||||
self._syncplayClient.setPosition(0)
|
||||
|
@ -440,7 +440,7 @@ def getListOfPublicServers():
|
||||
else:
|
||||
raise IOError
|
||||
except:
|
||||
if constants.DEBUG_MODE:
|
||||
if constants.DEBUG_MODE == True:
|
||||
traceback.print_exc()
|
||||
raise
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user