diff --git a/docs/changes.rst b/docs/changes.rst index 7fa59a3c..4d58ff4e 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -63,6 +63,10 @@ backends: and all functionality is maintained by assigning to the playlists collections at the backend level. + - :meth:`mopidy.core.StoredPlaylistsController.save` now returns the saved + playlist. The returned playlist may differ from the saved playlist, and + should thus be used instead of the saved playlist. + **Changes** - Made the :mod:`NAD mixer ` responsive to interrupts diff --git a/mopidy/core/stored_playlists.py b/mopidy/core/stored_playlists.py index b34b8bc1..8f87db58 100644 --- a/mopidy/core/stored_playlists.py +++ b/mopidy/core/stored_playlists.py @@ -136,8 +136,15 @@ class StoredPlaylistsController(object): """ Save the playlist to the set of stored playlists. + Returns the saved playlist. The return playlist may differ from the + saved playlist. E.g. if the playlist name was changed, the returned + playlist may have a different URI. The caller of this method should + throw away the playlist sent to this method, and use the returned + playlist instead. + :param playlist: the playlist :type playlist: :class:`mopidy.models.Playlist` + :rtype: :class:`mopidy.models.Playlist` """ # TODO Support multiple backends return self.backends[0].stored_playlists.save(playlist).get()