From 18be4a34a1cef2801e4cd0752ff73c391cf7788f Mon Sep 17 00:00:00 2001 From: Et0h Date: Thu, 21 Jan 2016 22:21:40 +0000 Subject: [PATCH] Hopefully fix playlist index random switch loop bug --- syncplay/client.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/syncplay/client.py b/syncplay/client.py index 534a22a..4a1d427 100644 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -484,7 +484,8 @@ class SyncplayClient(object): try: filename = self._playlist[index] self.ui.setPlaylistIndexFilename(filename) - self._playlistIndex = index + if not self._config['sharedPlaylistEnabled']: + self._playlistIndex = index if username is not None and self.userlist.currentUser.file and filename == self.userlist.currentUser.file['name']: return except IndexError: @@ -493,13 +494,11 @@ class SyncplayClient(object): if self._player is None: self.__playerReady.addCallback(lambda x: self.changeToPlaylistIndex(index, username)) return - + self._playlistIndex = index if username is None and self._protocol and self._protocol.logged and self._config["sharedPlaylistEnabled"]: - self._playlistIndex = index self._protocol.setPlaylistIndex(index) else: self.ui.showMessage(u"{} changed the playlist selection".format(username)) - self._playlistIndex = index self.switchToNewPlaylistIndex(index)