def play_latest_album_by_artist(artist_name): api = GMusicWrapper.generate_api() latest_album = api.get_latest_album(artist_name) if latest_album is False: return statement("Sorry, I couldn't find any albums") # Setup the queue first_song_id = queue.reset(latest_album['tracks']) # Start streaming the first track stream_url = api.get_stream_url(first_song_id) speech_text = "Playing album %s by %s" % (latest_album['name'], latest_album['albumArtist']) return audio(speech_text).play(stream_url)
def play_latest_album_by_artist(artist_name): api = GMusicWrapper.generate_api() latest_album = api.get_latest_album(artist_name) if latest_album is False: return statement(render_template("no_albums")) # Setup the queue first_song_id = queue.reset(latest_album['tracks']) # Start streaming the first track stream_url = api.get_stream_url(first_song_id) speech_text = render_template("play_album_text", album=latest_album['name'], artist=latest_album['albumArtist']) return audio(speech_text).play(stream_url)
def play_latest_album_by_artist(artist_name): # TODO -- can we do this without a subscription? if not api.use_store: return statement(render_template("not_supported_without_store")) api = GMusicWrapper.generate_api() latest_album = api.get_latest_album(artist_name) if latest_album is False: return statement(render_template("no_albums")) # Setup the queue first_song_id = queue.reset(latest_album['tracks']) # Start streaming the first track stream_url = api.get_stream_url(first_song_id) speech_text = render_template("play_album_text", album=latest_album['name'], artist=latest_album['albumArtist']) return audio(speech_text).play(stream_url)