def prevsong(): result = {} current_pos = int(mpd_kit.currentsong().get("pos")) playlist = [x for x in enumerate(mpd_kit.playlistinfo())] result = playlist[(current_pos - 1) % len(playlist)][1] return jsonify(result)
def currentsong(): result = mpd_kit.currentsong() return jsonify(result)