Exemplo n.º 1
0
def api_playlists_currentlist():
    client = init_mpd_client()
    playlist = client.playlistinfo()
    client.close()
    client.disconnect()

    return jsonify(playlist)
Exemplo n.º 2
0
def api_playlists():
    client = init_mpd_client()
    playlistList = client.listplaylists()
    client.close()
    client.disconnect()

    return jsonify(playlistList)
Exemplo n.º 3
0
def catch_all(path):
    client = init_mpd_client()
    currentsong = client.currentsong()

    emit_with_rating(client, currentsong)
    q.enqueue(emit_current_song, result_ttl=-1)
    return render_template("index.html")
Exemplo n.º 4
0
def on_playpos(data):
    client = init_mpd_client()
    client.clear()
    client.load(data)
    client.play(0)
    client.close()
    client.disconnect()
Exemplo n.º 5
0
def on_mpd_previous():
    client = init_mpd_client()
    client.previous()
    client.close()
    client.disconnect()
Exemplo n.º 6
0
def on_mpd_next():
    client = init_mpd_client()
    client.next()
    client.close()
    client.disconnect()
Exemplo n.º 7
0
def on_playpos(data):
    client = init_mpd_client()
    client.delete(data)
    client.close()
    client.disconnect()