From d6dac1d35b37f681f45340063baf4c48ffd0db33 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Tue, 8 Oct 2013 14:49:29 -0700 Subject: [PATCH] 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. --- beetsplug/scrub.py | 2 +- docs/changelog.rst | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/beetsplug/scrub.py b/beetsplug/scrub.py index 18fa41da3..c17ac99fb 100644 --- a/beetsplug/scrub.py +++ b/beetsplug/scrub.py @@ -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. diff --git a/docs/changelog.rst b/docs/changelog.rst index 2ebf6b185..e3ed38e94 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -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