public IResponseMessage Process(IRequest request) { GetPlaylistRequest concreteRequest = request as GetPlaylistRequest; spotifyWebApi.TokenType = concreteRequest.Token.TokenType; spotifyWebApi.AccessToken = concreteRequest.Token.AccessToken; FullPlaylist retVal = spotifyWebApi.GetPlaylist(concreteRequest.PlaylistUri); GetPlaylistResponseMessage responseMessage = Mapper.Map <FullPlaylist, GetPlaylistResponseMessage>(retVal); return(responseMessage); }
public IResponseMessage Process(IRequest request) { try { GetPlaylistResponseMessage playlistGetResponseMessage = GetPlaylist(request) as GetPlaylistResponseMessage; if (playlistGetResponseMessage.StatusCode == Status.FAILURE) { return(playlistGetResponseMessage); } ClearPlaylistRequest clearPlaylistRequest = request as ClearPlaylistRequest; List <DeleteTrackUri> PlaylistTracks = playlistGetResponseMessage.Playlist.Tracks.Items.Select(x => new DeleteTrackUri(x.Track.Uri)).ToList(); spotifyWebApi.AccessToken = request.Token.AccessToken; spotifyWebApi.TokenType = request.Token.TokenType; var retVal = spotifyWebApi.RemovePlaylistTracks(request.PlaylistUri, PlaylistTracks); } catch (Exception ex) { } return(null); }