def shuffle_off(): if len(queue.song_ids) == 0: return statement(render_template("shuffle_off")) # Start streaming the first track in the new shuffled list first_song_id = queue.shuffle_mode(False) stream_url = api.get_stream_url(first_song_id) return audio().enqueue(stream_url)
def shuffle_on(): if len(queue.song_ids) == 0: return statement("There are no songs to shuffle.") # Start streaming the first track in the new shuffled list first_song_id = queue.shuffle_mode(True) stream_url = api.get_stream_url(first_song_id) return audio().enqueue(stream_url)
def shuffle_off(): if len(queue.song_ids) == 0: return statement("There are no songs to unshuffle.") api = GMusicWrapper.generate_api() # Start streaming the first track in the new shuffled list first_song_id = queue.shuffle_mode(False) stream_url = api.get_stream_url(first_song_id) return audio().enqueue(stream_url)
def play_library(): if api.is_indexing(): return statement("Please wait for your tracks to finish indexing") tracks = api.library.values() first_song_id = queue.reset(tracks) first_song_id = queue.shuffle_mode(True) stream_url = api.get_stream_url(first_song_id) speech_text = "Playing music from your library" return audio(speech_text).play(stream_url)
def play_library(): if api.is_indexing(): return statement(render_template("indexing")) tracks = api.library.values() first_song_id = queue.reset(tracks) first_song_id = queue.shuffle_mode(True) stream_url = api.get_stream_url(first_song_id) speech_text = render_template("play_library_text") return audio(speech_text).play(stream_url)