Add retag plugin
This commit is contained in:
19
beetsplug/retag.py
Normal file
19
beetsplug/retag.py
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
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
|
||||||
Reference in New Issue
Block a user