from beets.plugins import BeetsPlugin class RetagPlugin(BeetsPlugin): def __init__(self): super(RetagPlugin, self).__init__() self.config.add({ 'clear': [ 'mb_trackid', 'mb_albumid', 'acoustid_id', 'acoustid_fingerprint' ] }) self.register_listener('import_task_start', self.clear_tags) @property def cleared_props(self): return self.config['clear'].as_str_seq() def clear_tags(self, session, task): for item in task.items: for prop in self.cleared_props: item[prop] = None