Example #1
0
def play_different_album():
    # 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()

    current_track = queue.current_track()

    if current_track is None:
        return statement(render_template("play_different_album_no_track"))

    album = api.get_album_by_artist(artist_name=current_track['artist'],
                                    album_id=current_track['albumId'])

    if album is False:
        return statement(render_template("no_album"))

    # Setup the queue
    first_song_id = queue.reset(album['tracks'])

    # Start streaming the first track
    stream_url = api.get_stream_url(first_song_id)

    speech_text = render_template("play_album_text",
                                  album=album['name'],
                                  artist=album['albumArtist'])
    return audio(speech_text).play(stream_url)
Example #2
0
def play_album_by_artist(artist_name):
    api = GMusicWrapper.generate_api()
    album = api.get_album_by_artist(artist_name=artist_name)

    if album is False:
        return statement("Sorry, I couldn't find any albums.")

    # Setup the queue
    first_song_id = queue.reset(album['tracks'])

    # Start streaming the first track
    stream_url = api.get_stream_url(first_song_id)

    speech_text = "Playing album %s by %s" % (album['name'], album['albumArtist'])
    return audio(speech_text).play(stream_url)
Example #3
0
def play_album_by_artist(artist_name):
    api = GMusicWrapper.generate_api()
    album = api.get_album_by_artist(artist_name=artist_name)

    if album is False:
        return statement(render_template("no_album"))

    # Setup the queue
    first_song_id = queue.reset(album['tracks'])

    # Start streaming the first track
    stream_url = api.get_stream_url(first_song_id)

    speech_text = render_template("play_album_text",
                                  album=album['name'],
                                  artist=album['albumArtist'])
    return audio(speech_text).play(stream_url)
Example #4
0
def play_different_album():
    api = GMusicWrapper.generate_api()

    current_track = queue.current_track()

    if current_track is None:
        return statement("Sorry, there's no album playing currently")

    album = api.get_album_by_artist(artist_name=current_track['artist'], album_id=current_track['albumId'])

    if album is False:
        return statement("Sorry, I couldn't find any albums.")

    # Setup the queue
    first_song_id = queue.reset(album['tracks'])

    # Start streaming the first track
    stream_url = api.get_stream_url(first_song_id)

    speech_text = "Playing album %s by %s" % (album['name'], album['albumArtist'])
    return audio(speech_text).play(stream_url)