By default only autoplay if all filenames are the same

This commit is contained in:
Et0h 2015-10-12 20:47:51 +01:00
parent 63731811ae
commit aceba941fa
2 changed files with 10 additions and 5 deletions

View File

@ -688,7 +688,7 @@ class SyncplayClient(object):
return False
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):
return self.autoplayTimer.running
@ -1117,14 +1117,17 @@ class SyncplayUserlist(object):
user = self._users[username]
user.setControllerStatus(True)
def areAllUsersInRoomReady(self):
def areAllUsersInRoomReady(self, requireSameFilenames=False):
if not self.currentUser.canControl():
return True
if not self.currentUser.isReady():
return False
for user in self._users.itervalues():
if user.room == self.currentUser.room and user.isReadyWithFile() == False:
return False
if user.room == self.currentUser.room:
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
def areAllOtherUsersInRoomReady(self):

View File

@ -51,6 +51,7 @@ class ConfigurationGetter(object):
"unpauseAction": constants.UNPAUSE_IFOTHERSREADY_MODE,
"autoplayInitialState" : None,
"autoplayMinUsers" : -1,
"autoplayRequireSameFilenames": True,
"clearGUIData": False,
"language" : "",
"checkForUpdatesAutomatically" : None,
@ -87,6 +88,7 @@ class ConfigurationGetter(object):
"dontSlowDownWithMe",
"pauseOnLeave",
"readyAtStart",
"autoplayRequireSameFilenames",
"clearGUIData",
"rewindOnDesync",
"slowOnDesync",
@ -121,7 +123,7 @@ class ConfigurationGetter(object):
self._iniStructure = {
"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"],
"general": ["language", "checkForUpdatesAutomatically", "lastCheckedForUpdates"]
}