From 5143e630d8e23ba69893988bbd7d635629809ec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Koutensk=C3=BD?= Date: Wed, 22 Apr 2020 19:44:47 +0200 Subject: [PATCH] Fix #3533 - crash when calculating RG/R128 mix --- beetsplug/replaygain.py | 8 ++++---- docs/changelog.rst | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/beetsplug/replaygain.py b/beetsplug/replaygain.py index 646e3acce..916541df6 100644 --- a/beetsplug/replaygain.py +++ b/beetsplug/replaygain.py @@ -1326,10 +1326,10 @@ class ReplayGainPlugin(BeetsPlugin): if (any([self.should_use_r128(item) for item in album.items()]) and not all(([self.should_use_r128(item) for item in album.items()]))): - raise ReplayGainError( - u"Mix of ReplayGain and EBU R128 detected" - u" for some tracks in album {0}".format(album) - ) + self._log.info( + u"Cannot calculate gain for album {0} (incompatible formats)", + album) + return tag_vals = self.tag_specific_values(album.items()) store_track_gain, store_album_gain, target_level, peak = tag_vals diff --git a/docs/changelog.rst b/docs/changelog.rst index 69f855507..e2f1521eb 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -185,6 +185,12 @@ Fixes: can help find matches when the artist name has special characters. Thanks to :user:`hashhar`. :bug:`3340` :bug:`3558` +* :doc:`/plugins/replaygain`: Trying to calculate volume gain for an album + consisting of some formats using ``ReplayGain`` and some using ``R128`` + will no longer crash; instead it is skipped and and a message is logged. + The log message has also been rewritten for to improve clarity. + Thanks to :user:`autrimpo`. + :bug:`3533` For plugin developers: