class SpotifySpeech {

	@Intent()
	public Response searchASong(Map<String, EntityData> entites) {
		switch (entites.get("mode").getString()) {
		case "track":
		case "song":
			List<TrackEntity> tracks = this.search.searchforTracks(entites.get("name").getString(), 1);
			if (!tracks.isEmpty() && tracks.get(0) != null) {
				return Response.text(this.playerLogic.playTrack(0).toString())
                    .widget("app-current-song")
                    .build();
			}
			break;
		case "playlist":
			List<PlaylistEntity> playlists = this.search.searchforPlaylists(entites.get("name").getString(), 1);
			if (!playlists.isEmpty() && playlists.get(0) != null) {
				return Response.text(this.playerLogic.playPlaylist(0, SearchTypes.SEARCH_PLAYLISTS).toString()).build();
			}
			break;
		case "album":
			List<AlbumEntity> albums = this.search.searchforAlbums(entites.get("name").getString(), 1);
			if (!albums.isEmpty() && albums.get(0) != null) {
				return Response.text(this.playerLogic.playAlbum(0).toString()).build();
			}
			break;
		case "artist":
			List<ArtistEntity> artists = this.search.searchforArtists(entites.get("name").getString(), 1);
			if (!artists.isEmpty() && artists.get(0) != null) {
				return Response.text(this.playerLogic.playArtist(0).toString()).build();
			}
			break;
		default:
			break;
		}

		return Response.text(ERROR_MESSAGE_ELEMENT).build();
	}

}