mirror of
https://github.com/beetbox/beets.git
synced 2026-01-14 12:12:23 +01:00
Zero plugin: do not zero important fields
Prevent zeroing fields id, album_id and path. Fix issue #475.
This commit is contained in:
parent
63af350eaa
commit
469ec40c0f
1 changed files with 4 additions and 0 deletions
|
|
@ -47,6 +47,10 @@ class ZeroPlugin(BeetsPlugin):
|
|||
self.warned = False
|
||||
|
||||
for field in self.config['fields'].as_str_seq():
|
||||
if field in ('id', 'path', 'album_id'):
|
||||
log.warn(u'[zero] field \'{0}\' ignored, zeroing '
|
||||
u'it would be dangerous'.format(field))
|
||||
continue
|
||||
if field not in Item._fields.keys():
|
||||
log.error(u'[zero] invalid field: {0}'.format(field))
|
||||
continue
|
||||
|
|
|
|||
Loading…
Reference in a new issue