Server only accepts playlist/index changes from room operators in managed rooms
This commit is contained in:
parent
a85f9bae6c
commit
5d5c0a741b
@ -138,12 +138,22 @@ class SyncFactory(Factory):
|
|||||||
self._roomManager.broadcastRoom(watcher, lambda w: w.sendSetReady(watcher.getName(), watcher.isReady(), manuallyInitiated))
|
self._roomManager.broadcastRoom(watcher, lambda w: w.sendSetReady(watcher.getName(), watcher.isReady(), manuallyInitiated))
|
||||||
|
|
||||||
def setPlaylist(self, watcher, files):
|
def setPlaylist(self, watcher, files):
|
||||||
watcher.getRoom().setPlaylist(files, watcher)
|
room = watcher.getRoom()
|
||||||
self._roomManager.broadcastRoom(watcher, lambda w: w.setPlaylist(watcher.getName(), files))
|
if room.canControl(watcher):
|
||||||
|
watcher.getRoom().setPlaylist(files, watcher)
|
||||||
|
self._roomManager.broadcastRoom(watcher, lambda w: w.setPlaylist(watcher.getName(), files))
|
||||||
|
else:
|
||||||
|
watcher.setPlaylist(room.getName(), room.getPlaylist())
|
||||||
|
watcher.setPlaylistIndex(room.getName(), room.getPlaylistIndex())
|
||||||
|
|
||||||
|
|
||||||
def setPlaylistIndex(self, watcher, index):
|
def setPlaylistIndex(self, watcher, index):
|
||||||
watcher.getRoom().setPlaylistIndex(index, watcher)
|
room = watcher.getRoom()
|
||||||
self._roomManager.broadcastRoom(watcher, lambda w: w.setPlaylistIndex(watcher.getName(), index))
|
if room.canControl(watcher):
|
||||||
|
watcher.getRoom().setPlaylistIndex(index, watcher)
|
||||||
|
self._roomManager.broadcastRoom(watcher, lambda w: w.setPlaylistIndex(watcher.getName(), index))
|
||||||
|
else:
|
||||||
|
watcher.setPlaylistIndex(room.getName(), room.getPlaylistIndex())
|
||||||
|
|
||||||
class RoomManager(object):
|
class RoomManager(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user