By default only autoplay if all filenames are the same
This commit is contained in:
parent
63731811ae
commit
aceba941fa
@ -688,7 +688,7 @@ class SyncplayClient(object):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def autoplayConditionsMet(self):
|
def autoplayConditionsMet(self):
|
||||||
return self._playerPaused and self.autoPlay and self.userlist.currentUser.canControl() and self.userlist.isReadinessSupported() and self.userlist.areAllUsersInRoomReady() and self.autoPlayThreshold and self.userlist.usersInRoomCount() >= self.autoPlayThreshold
|
return self._playerPaused and self.autoPlay and self.userlist.currentUser.canControl() and self.userlist.isReadinessSupported() and self.userlist.areAllUsersInRoomReady(requireSameFilenames=self._config["autoplayRequireSameFilenames"]) and self.autoPlayThreshold and self.userlist.usersInRoomCount() >= self.autoPlayThreshold
|
||||||
|
|
||||||
def autoplayTimerIsRunning(self):
|
def autoplayTimerIsRunning(self):
|
||||||
return self.autoplayTimer.running
|
return self.autoplayTimer.running
|
||||||
@ -1117,14 +1117,17 @@ class SyncplayUserlist(object):
|
|||||||
user = self._users[username]
|
user = self._users[username]
|
||||||
user.setControllerStatus(True)
|
user.setControllerStatus(True)
|
||||||
|
|
||||||
def areAllUsersInRoomReady(self):
|
def areAllUsersInRoomReady(self, requireSameFilenames=False):
|
||||||
if not self.currentUser.canControl():
|
if not self.currentUser.canControl():
|
||||||
return True
|
return True
|
||||||
if not self.currentUser.isReady():
|
if not self.currentUser.isReady():
|
||||||
return False
|
return False
|
||||||
for user in self._users.itervalues():
|
for user in self._users.itervalues():
|
||||||
if user.room == self.currentUser.room and user.isReadyWithFile() == False:
|
if user.room == self.currentUser.room:
|
||||||
return False
|
if user.isReadyWithFile() == False:
|
||||||
|
return False
|
||||||
|
elif requireSameFilenames and (self.currentUser.file is None or user.file is None or not utils.sameFilename(self.currentUser.file['name'], user.file['name'])):
|
||||||
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def areAllOtherUsersInRoomReady(self):
|
def areAllOtherUsersInRoomReady(self):
|
||||||
|
|||||||
@ -51,6 +51,7 @@ class ConfigurationGetter(object):
|
|||||||
"unpauseAction": constants.UNPAUSE_IFOTHERSREADY_MODE,
|
"unpauseAction": constants.UNPAUSE_IFOTHERSREADY_MODE,
|
||||||
"autoplayInitialState" : None,
|
"autoplayInitialState" : None,
|
||||||
"autoplayMinUsers" : -1,
|
"autoplayMinUsers" : -1,
|
||||||
|
"autoplayRequireSameFilenames": True,
|
||||||
"clearGUIData": False,
|
"clearGUIData": False,
|
||||||
"language" : "",
|
"language" : "",
|
||||||
"checkForUpdatesAutomatically" : None,
|
"checkForUpdatesAutomatically" : None,
|
||||||
@ -87,6 +88,7 @@ class ConfigurationGetter(object):
|
|||||||
"dontSlowDownWithMe",
|
"dontSlowDownWithMe",
|
||||||
"pauseOnLeave",
|
"pauseOnLeave",
|
||||||
"readyAtStart",
|
"readyAtStart",
|
||||||
|
"autoplayRequireSameFilenames",
|
||||||
"clearGUIData",
|
"clearGUIData",
|
||||||
"rewindOnDesync",
|
"rewindOnDesync",
|
||||||
"slowOnDesync",
|
"slowOnDesync",
|
||||||
@ -121,7 +123,7 @@ class ConfigurationGetter(object):
|
|||||||
|
|
||||||
self._iniStructure = {
|
self._iniStructure = {
|
||||||
"server_data": ["host", "port", "password"],
|
"server_data": ["host", "port", "password"],
|
||||||
"client_settings": ["name", "room", "playerPath", "perPlayerArguments", "slowdownThreshold", "rewindThreshold", "fastforwardThreshold", "slowOnDesync", "rewindOnDesync", "fastforwardOnDesync", "dontSlowDownWithMe", "forceGuiPrompt", "filenamePrivacyMode", "filesizePrivacyMode", "unpauseAction", "pauseOnLeave", "readyAtStart", "autoplayMinUsers", "autoplayInitialState", "mediaSearchDirectories"],
|
"client_settings": ["name", "room", "playerPath", "perPlayerArguments", "slowdownThreshold", "rewindThreshold", "fastforwardThreshold", "slowOnDesync", "rewindOnDesync", "fastforwardOnDesync", "dontSlowDownWithMe", "forceGuiPrompt", "filenamePrivacyMode", "filesizePrivacyMode", "unpauseAction", "pauseOnLeave", "readyAtStart", "autoplayMinUsers", "autoplayInitialState", "autoplayRequireSameFilenames", "mediaSearchDirectories"],
|
||||||
"gui": ["showOSD", "showOSDWarnings", "showSlowdownOSD", "showDifferentRoomOSD", "showSameRoomOSD", "showNonControllerOSD", "showDurationNotification"],
|
"gui": ["showOSD", "showOSDWarnings", "showSlowdownOSD", "showDifferentRoomOSD", "showSameRoomOSD", "showNonControllerOSD", "showDurationNotification"],
|
||||||
"general": ["language", "checkForUpdatesAutomatically", "lastCheckedForUpdates"]
|
"general": ["language", "checkForUpdatesAutomatically", "lastCheckedForUpdates"]
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user