Restore server-side playlist on reconnect (#567)

This commit is contained in:
Etoh 2023-02-23 19:27:15 +00:00 committed by GitHub
parent e1bcf12a1a
commit 9b9707a978
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1929,7 +1929,13 @@ class SyncplayPlaylist():
self._ui.showMessage("Playlist saved as {}".format(path)) # TODO: Move to messages_en self._ui.showMessage("Playlist saved as {}".format(path)) # TODO: Move to messages_en
def playlistNeedsRestoring(self, files, username):
return self._client.sharedPlaylistIsEnabled() and self._playlist != None and files == [] and username == None and not self._playlistBufferIsFromOldRoom(self._client.userlist.currentUser.room)
def changePlaylist(self, files, username=None, resetIndex=False): def changePlaylist(self, files, username=None, resetIndex=False):
if self.playlistNeedsRestoring(files, username):
files = self._playlist.copy()
self._playlist = []
self.queuedIndexFilename = None self.queuedIndexFilename = None
if self._playlist == files: if self._playlist == files:
if self._playlistIndex != 0 and resetIndex: if self._playlistIndex != 0 and resetIndex: