zero: fix nulling fields containing None

This commit is contained in:
Adrian Sampson 2013-06-01 17:28:59 -07:00
parent 4624f65ce3
commit 9a6b6240d0
2 changed files with 4 additions and 1 deletions

View file

@ -89,6 +89,7 @@ class ZeroPlugin(BeetsPlugin):
continue
self._log.debug(u'[zero] \"{0}\" ({1}) match: {2}'
.format(fval, fn, ' '.join(patterns)))
setattr(item, fn, type(fval)())
new_val = None if fval is None else type(fval)()
setattr(item, fn, new_val)
self._log.debug(u'[zero] {0}={1}'
.format(fn, getattr(item, fn)))

View file

@ -47,6 +47,8 @@ Changelog
that go missing.
* The :ref:`modify-cmd` command can now change albums' album art paths (i.e.,
``beet modify artpath=...`` works). Thanks to Lucas Duailibe.
* :doc:`/plugins/zero`: Fix a crash when nulling out a field that contains
None.
* Various UI enhancements to the importer due to Tai Lee:
* More consistent format and colorization of album and track metadata.