From 531025f799b1b854f868bf7c54f87cac6b843e05 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Tue, 11 Dec 2012 13:06:57 -0800 Subject: [PATCH] replaygain: restrict file formats (GC-469) --- beetsplug/replaygain.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/beetsplug/replaygain.py b/beetsplug/replaygain.py index 06fd02301..882032130 100755 --- a/beetsplug/replaygain.py +++ b/beetsplug/replaygain.py @@ -162,6 +162,10 @@ class ReplayGainPlugin(BeetsPlugin): def requires_gain(self, item, album=False): """Does the gain need to be computed?""" + if 'mp3gain' in self.command and item.format != 'MP3': + return False + elif 'aacgain' in self.command and item.format not in ('MP3', 'AAC'): + return False return self.overwrite or \ (not item.rg_track_gain or not item.rg_track_peak) or \ ((not item.rg_album_gain or not item.rg_album_peak) and \