Skip to content

Commit d6dac1d

Browse files
committed
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.
1 parent c0c01b2 commit d6dac1d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

beetsplug/scrub.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,12 @@ def _scrub(path):
127127
# remove them. In this case, we just remove all the tags.
128128
for tag in f.keys():
129129
del f[tag]
130+
f.save()
130131
except IOError as exc:
131132
log.error(u'could not scrub {0}: {1}'.format(
132133
util.displayable_path(path),
133134
exc,
134135
))
135-
f.save()
136136

137137

138138
# Automatically embed art into imported albums.

docs/changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ And some fixes:
5656
Thanks to Pedro Silva.
5757
* Fix an occasional KeyError in the :ref:`update-cmd` command introduced in
5858
1.3.0.
59+
* :doc:`/plugins/scrub`: Avoid preserving certain non-standard ID3 tags such
60+
as NCON.
5961

6062
.. _Opus: http://www.opus-codec.org/
6163
.. _@Verrus: https://github.com/Verrus

0 commit comments

Comments
 (0)