def libraryList(directory='/'): '''Return a list of the contents of a directory in the music library.''' r = [] for item in mpc.client.lsinfo(directory): keys = item.keys() if 'playlist' in keys: r.append({'playlist':item['playlist']}) elif 'directory' in keys: r.append({'directory':item['directory']}) else: r.append(filter_song(item)) return r
def queueList(): '''Return a list of songs in the play queue.''' songs = mpc.client.playlistinfo() return [filter_song(song) for song in songs]
def queueCurrent(): '''Return the currently playing song.''' return filter_song(mpc.client.currentsong())
def librarySearch(type_, needle): '''Return a list of songs where metadata [type_] contains [needle].''' return [filter_song(item) for item in mpc.client.search(type_, needle)]
def libraryFind(type_, needle): '''Return a list of songs where [needle] exactly matches metadata [type_].''' return [filter_song(item) for item in mpc.client.find(type_, needle)]
def libraryListAll(): '''Return a list of all songs in the music library.''' return [filter_song(item) for item in mpc.client.listallinfo()]
def playlistInfo(name): '''Return a list of songs contained in stored playlist [name].''' return [filter_song(s) for s in mpc.client.listplaylistinfo(name)]