Example #1
0
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
Example #2
0
def queueList():
    '''Return a list of songs in the play queue.'''
    songs = mpc.client.playlistinfo()
    return [filter_song(song) for song in songs]
Example #3
0
def queueCurrent():
    '''Return the currently playing song.'''
    return filter_song(mpc.client.currentsong())
Example #4
0
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)]
Example #5
0
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)]
Example #6
0
def libraryListAll():
    '''Return a list of all songs in the music library.'''
    return [filter_song(item) for item in mpc.client.listallinfo()]
Example #7
0
def playlistInfo(name):
    '''Return a list of songs contained in stored playlist [name].'''
    return [filter_song(s) for s in mpc.client.listplaylistinfo(name)]