mirror of https://github.com/Syncplay/syncplay
Re-work readiness notifications for non-operators (#607)
This commit is contained in:
parent
b62b038cdf
commit
8772c5ea51
|
@ -1,5 +1,5 @@
|
||||||
version = '1.7.0'
|
version = '1.7.0'
|
||||||
revision = ''
|
revision = ''
|
||||||
milestone = 'Yoitsu'
|
milestone = 'Yoitsu'
|
||||||
release_number = '105'
|
release_number = '106'
|
||||||
projectURL = 'https://syncplay.pl/'
|
projectURL = 'https://syncplay.pl/'
|
||||||
|
|
|
@ -1186,10 +1186,10 @@ class SyncplayClient(object):
|
||||||
return
|
return
|
||||||
if self._client.getPlayerPaused() or not self._userlist.currentUser.isReady():
|
if self._client.getPlayerPaused() or not self._userlist.currentUser.isReady():
|
||||||
self._warnings["not-all-ready"]["displayedFor"] = 0
|
self._warnings["not-all-ready"]["displayedFor"] = 0
|
||||||
if self._userlist.areYouAloneInRoom() or not self._userlist.currentUser.canControl():
|
if self._userlist.areYouAloneInRoom():
|
||||||
if self._warnings["not-all-ready"]['timer'].running:
|
if self._warnings["not-all-ready"]['timer'].running:
|
||||||
self._warnings["not-all-ready"]['timer'].stop()
|
self._warnings["not-all-ready"]['timer'].stop()
|
||||||
elif not self._userlist.areAllUsersInRoomReady():
|
elif not self._userlist.areAllRelevantUsersInRoomReady():
|
||||||
self._displayReadySameWarning()
|
self._displayReadySameWarning()
|
||||||
if constants.SHOW_OSD_WARNINGS and not self._warnings["not-all-ready"]['timer'].running:
|
if constants.SHOW_OSD_WARNINGS and not self._warnings["not-all-ready"]['timer'].running:
|
||||||
self._warnings["not-all-ready"]['timer'].start(constants.WARNING_OSD_MESSAGES_LOOP_INTERVAL, True)
|
self._warnings["not-all-ready"]['timer'].start(constants.WARNING_OSD_MESSAGES_LOOP_INTERVAL, True)
|
||||||
|
@ -1450,9 +1450,28 @@ class SyncplayUserlist(object):
|
||||||
user = self._users[username]
|
user = self._users[username]
|
||||||
user.setControllerStatus(True)
|
user.setControllerStatus(True)
|
||||||
|
|
||||||
def areAllUsersInRoomReady(self, requireSameFilenames=False):
|
def areAllRelevantUsersInRoomReady(self, requireSameFilenames=False):
|
||||||
if not self.currentUser.canControl():
|
if not self.currentUser.isReady():
|
||||||
|
return False
|
||||||
|
if self.currentUser.canControl():
|
||||||
|
return self.areAllUsersInRoomReady(requireSameFilenames)
|
||||||
|
else:
|
||||||
|
for user in self._users.values():
|
||||||
|
if user.room == self.currentUser.room and user.canControl():
|
||||||
|
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 areAllUsersInRoomReady(self, requireSameFilenames=False):
|
||||||
if not self.currentUser.isReady():
|
if not self.currentUser.isReady():
|
||||||
return False
|
return False
|
||||||
for user in self._users.values():
|
for user in self._users.values():
|
||||||
|
|
Loading…
Reference in New Issue