'Return a map of the collections in books: {lpaths: [collection names]}'

def build_id_playlist_map(self, bl_index):

    debug_print('Start    build_id_playlist_map')
    self.ensure_unique_playlist_titles()
    self.prune_empty_playlists()
    debug_print('after    cleaning    playlists')
    root = self.record_roots[bl_index]
    if (root is None):
        return
    id_map = self.build_id_map(root)
    playlist_map = {}
    for playlist in root.xpath('//*[local-name()="playlist"]'):
        name = playlist.get('title')
        if (name is None):
            debug_print('build_id_playlist_map:    unnamed    playlist!')
            continue
        for item in playlist:
            id_ = item.get('id', None)
            if (id_ is None):
                debug_print('build_id_playlist_map:    id_    is    None!')
                continue
            bk = id_map.get(id_, None)
            if (bk is None):
                debug_print('build_id_playlist_map:    book    is    None!', id_)
                continue
            lpath = bk.get('path', None)
            if (lpath is None):
                debug_print('build_id_playlist_map:    lpath    is    None!', id_)
                continue
            if (lpath not in playlist_map):
                playlist_map[lpath] = []
            playlist_map[lpath].append(name)
    debug_print('Finish    build_id_playlist_map.    Found', len(playlist_map))
    return playlist_map
