예제 #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
예제 #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]
예제 #3
0
def queueCurrent():
    '''Return the currently playing song.'''
    return filter_song(mpc.client.currentsong())
예제 #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)]
예제 #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)]
예제 #6
0
def libraryListAll():
    '''Return a list of all songs in the music library.'''
    return [filter_song(item) for item in mpc.client.listallinfo()]
예제 #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)]