diff --git a/beetsplug/replaygain.py b/beetsplug/replaygain.py index 2bea72d96..4857566d9 100644 --- a/beetsplug/replaygain.py +++ b/beetsplug/replaygain.py @@ -198,6 +198,9 @@ class CommandBackend(Backend): out = [] for line in text.split('\n')[1:num_lines + 1]: parts = line.split('\t') + if len(parts) != 6 or parts[0] == 'File': + log.debug(u'replaygain: bad tool output: {0}'.format(text)) + raise ReplayGainError('mp3gain failed') d = { 'file': parts[0], 'mp3gain': int(parts[1]), diff --git a/docs/changelog.rst b/docs/changelog.rst index a517c6374..4c28a2f84 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -62,6 +62,9 @@ Fixes: whitelist. Thanks to gwern. * :doc:`/plugins/importfeeds`: A new ``echo`` output mode prints files' paths to standard error. Thanks to robotanarchy. +* :doc:`/plugins/replaygain`: Restore some error handling when ``mp3gain`` + output cannot be parsed. The verbose log now contains the bad tool output in + this case. .. _discogs_client: https://github.com/discogs/discogs_client