replaygain: Check for bad mp3gain output (#961)

This commit is contained in:
Adrian Sampson 2014-09-15 10:25:57 -07:00
parent a17e8b54be
commit 84c0f909b6
2 changed files with 6 additions and 0 deletions

View file

@ -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]),

View file

@ -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