def METHOD_NAME(self):
    def build_playlist(lib, opts, args):
        self.config.set_args(opts)
        ids = self.config['playlist_ids'].as_str_seq()
        if self.config['playlist_names'].as_str_seq():
            playlists = ElementTree.fromstring(
                self.send('getPlaylists').text)[0]
            if playlists.attrib.get('code', '200') != '200':
                alt_error = 'error getting playlists,' \
                            ' but no error message found'
                self._log.warn(
                    playlists.attrib.get('message', alt_error))
                return
            for name in self.config['playlist_names'].as_str_seq():
                for playlist in playlists:
                    if name == playlist.attrib['name']:
                        ids.append(playlist.attrib['id'])
        playlist_dict = self.get_playlists(ids)
        # delete old tags
        if self.config['delete']:
            existing = list(lib.items('subsonic_playlist:";"'))
            to_be_removed = filter_to_be_removed(
                existing,
                playlist_dict.keys())
            for item in to_be_removed:
                item['subsonic_playlist'] = ''
                with lib.transaction():
                    item.try_sync(write=True, move=False)
        self.update_tags(playlist_dict, lib)
    subsonicplaylist_cmds = Subcommand(
        'subsonicplaylist', help='import a subsonic playlist'
    )
    subsonicplaylist_cmds.parser.add_option(
        '-d',
        '--delete',
        action='store_true',
        help='delete tag from items not in any playlist anymore',
    )
    subsonicplaylist_cmds.func = build_playlist
    return [subsonicplaylist_cmds]