From b794e34c4e1b5863ad29d12ebad5897a7d787565 Mon Sep 17 00:00:00 2001 From: Christian Date: Sat, 13 Jan 2018 17:27:59 +0100 Subject: [PATCH] Guard against slave players in create_sonos_playlist_from_queue --- soco/playlists.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/soco/playlists.py b/soco/playlists.py index da9d6d539..d1faefb9c 100644 --- a/soco/playlists.py +++ b/soco/playlists.py @@ -13,6 +13,7 @@ DidlPlaylistContainer ) from .data_structures import to_didl_string +from .exceptions import SoCoSlaveException class PlaylistManager(object): @@ -88,6 +89,12 @@ def create_sonos_playlist_from_queue(self, title, player=None): # but this has not been tested. This method is what the # controller uses. player = player or self.soco + if not player.is_coordinator: + message = 'The method "{0}" can only be used '\ + 'on the coordinator in a group'.format( + self.create_sonos_playlist_from_queue.__name__) + raise SoCoSlaveException(message) + response = player.avTransport.SaveQueue([ ('InstanceID', 0), ('Title', title),