Syncplay should not re-open current file (it causes rewinds on some players)
This commit is contained in:
parent
abd46d0e6c
commit
ad9b3884a6
@ -600,6 +600,8 @@ class MainWindow(QtGui.QMainWindow):
|
|||||||
def playlistItemClicked(self, item):
|
def playlistItemClicked(self, item):
|
||||||
# TODO: Integrate into client.py code
|
# TODO: Integrate into client.py code
|
||||||
filename = item.data()
|
filename = item.data()
|
||||||
|
if self._isTryingToChangeToCurrentFile(filename):
|
||||||
|
return
|
||||||
if isURL(filename):
|
if isURL(filename):
|
||||||
self._syncplayClient._player.openFile(filename)
|
self._syncplayClient._player.openFile(filename)
|
||||||
else:
|
else:
|
||||||
@ -609,6 +611,13 @@ class MainWindow(QtGui.QMainWindow):
|
|||||||
else:
|
else:
|
||||||
self._syncplayClient.ui.showErrorMessage(getMessage("cannot-find-file-for-playlist-switch-error").format(filename))
|
self._syncplayClient.ui.showErrorMessage(getMessage("cannot-find-file-for-playlist-switch-error").format(filename))
|
||||||
|
|
||||||
|
def _isTryingToChangeToCurrentFile(self, filename):
|
||||||
|
if self._syncplayClient.userlist.currentUser.file and filename == self._syncplayClient.userlist.currentUser.file["name"]:
|
||||||
|
self.showDebugMessage("File change request ignored (Syncplay should not be asked to change to current filename)")
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
def roomClicked(self, item):
|
def roomClicked(self, item):
|
||||||
username = item.sibling(item.row(), 0).data()
|
username = item.sibling(item.row(), 0).data()
|
||||||
filename = item.sibling(item.row(), 3).data()
|
filename = item.sibling(item.row(), 3).data()
|
||||||
@ -618,7 +627,7 @@ class MainWindow(QtGui.QMainWindow):
|
|||||||
if roomToJoin <> self._syncplayClient.getRoom():
|
if roomToJoin <> self._syncplayClient.getRoom():
|
||||||
self.joinRoom(item.sibling(item.row(), 0).data())
|
self.joinRoom(item.sibling(item.row(), 0).data())
|
||||||
elif username and filename and username <> self._syncplayClient.userlist.currentUser.username:
|
elif username and filename and username <> self._syncplayClient.userlist.currentUser.username:
|
||||||
if self._syncplayClient.userlist.currentUser.file and filename == self._syncplayClient.userlist.currentUser.file:
|
if self._isTryingToChangeToCurrentFile(filename):
|
||||||
return
|
return
|
||||||
if isURL(filename):
|
if isURL(filename):
|
||||||
self._syncplayClient._player.openFile(filename)
|
self._syncplayClient._player.openFile(filename)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user