Skip to content

Commit

Permalink
Actually executing filechanges for numeric keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Uriziel committed Oct 1, 2015
1 parent efe32b4 commit 3322e94
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions syncplay/client.py
Expand Up @@ -411,7 +411,13 @@ def updateFile(self, filename, duration, path):
self.userlist.currentUser.setFile(filename, duration, size, path)
self.sendFile()

# TODO: execute changeToPlaylistIndex if file found in playlist
# TODO: Fix for GUIDS
try:
index = self._playlist.index(filename)
self.changeToPlaylistIndex(index)
except ValueError:
pass


def changeToPlaylistIndex(self, index, username = None):
if self._playlistIndex == index:
Expand All @@ -421,8 +427,7 @@ def changeToPlaylistIndex(self, index, username = None):
self._protocol.setPlaylistIndex(index)
elif username != self.getUsername():
# TODO: Display info about playlist file change

if index in self._playlist:
try:
filename = self._playlist[index]
# TODO: Find Path
path = 'https://www.youtube.com/watch?v=0iXX5h6Hxxs'
Expand All @@ -431,6 +436,8 @@ def changeToPlaylistIndex(self, index, username = None):
else:
# TODO: Notify user about file not found
pass
except IndexError:
pass

def changePlaylist(self, files, username = None):
self._playlist = files
Expand Down

0 comments on commit 3322e94

Please sign in to comment.