savePlaylist method

  1. @override
Future<SavePlaylistResponse> savePlaylist(
  1. Playlist playlist, {
  2. List<String>? shaderIds,
})

Saves a Playlist and optionally the playlist shaders

On success the Playlist and optionally the playlist shaders are saved

In case of error a ResponseError is set on SavePlaylistResponse

Implementation

@override
Future<SavePlaylistResponse> savePlaylist(Playlist playlist,
    {List<String>? shaderIds}) {
  return catchSqlError<SavePlaylistResponse>(
      store.playlistDao
          .save(playlist, shaderIds: shaderIds)
          .then((reponse) => SavePlaylistResponse()),
      (sqle) => SavePlaylistResponse(
          error: toResponseError(sqle,
              context: contextPlaylist, target: playlist.id)),
      options);
}