Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions syncplay/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2044,6 +2044,13 @@ def changePlaylist(self, files, username=None, resetIndex=False):
self._client._protocol.setPlaylist(files)
self._client._protocol.setPlaylistIndex(self._playlistIndex)
return
if username is None:
if len(files) > constants.PLAYLIST_MAX_ITEMS:
self._ui.showErrorMessage(getMessage("playlist-too-many-items-error").format(constants.PLAYLIST_MAX_ITEMS))
return
if sum(map(len, files)) > constants.PLAYLIST_MAX_CHARACTERS:
self._ui.showErrorMessage(getMessage("playlist-too-many-characters-error").format(constants.PLAYLIST_MAX_CHARACTERS))
return
self.queuedIndexFilename = None
self._client.playlistMayNeedRestoring = False
if self._playlist == files:
Expand Down
2 changes: 2 additions & 0 deletions syncplay/messages_en.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,4 +560,6 @@

"playlist-empty-error": "Playlist is currently empty.",
"playlist-invalid-index-error": "Invalid playlist index",
"playlist-too-many-items-error": "Playlist exceeds the maximum number of items ({}).", # PLAYLIST_MAX_ITEMS
"playlist-too-many-characters-error": "Playlist exceeds the maximum total character count ({}).", # PLAYLIST_MAX_CHARACTERS
}
Loading