scrub: no need to save after delete()

The delete() method on Mutagen objects writes the file directly. Calling
save() was unnecessary and, in at least one case we found, could inadvertently
preserve non-standard tags that Mutagen did not understand.
This commit is contained in:
Adrian Sampson 2013-10-08 14:49:29 -07:00
parent c0c01b2680
commit d6dac1d35b
2 changed files with 3 additions and 1 deletions

View file

@ -127,12 +127,12 @@ def _scrub(path):
# remove them. In this case, we just remove all the tags.
for tag in f.keys():
del f[tag]
f.save()
except IOError as exc:
log.error(u'could not scrub {0}: {1}'.format(
util.displayable_path(path),
exc,
))
f.save()
# Automatically embed art into imported albums.

View file

@ -56,6 +56,8 @@ And some fixes:
Thanks to Pedro Silva.
* Fix an occasional KeyError in the :ref:`update-cmd` command introduced in
1.3.0.
* :doc:`/plugins/scrub`: Avoid preserving certain non-standard ID3 tags such
as NCON.
.. _Opus: http://www.opus-codec.org/
.. _@Verrus: https://github.com/Verrus