Skip to content

Commit

Permalink
raise an exception on mixed albums
Browse files Browse the repository at this point in the history
  • Loading branch information
autrimpo committed May 16, 2017
1 parent 2cde5c0 commit 13eca81
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 21 deletions.
22 changes: 2 additions & 20 deletions beets/mediafile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2013,17 +2013,8 @@ def update(self, dict):
MP3DescStorageStyle(
u'r128_track_gain'
),
MP3SoundCheckStorageStyle(
key='COMM',
index=0, desc=u'iTunR128',
id3_lang='eng'
),
MP4StorageStyle(
'----:com.apple.iTunes:r128_track_gain'
),
MP4SoundCheckStorageStyle(
'----:com.apple.iTunes:iTunR128',
index=0
'com.apple.iTunes:r128_track_gain'
),
StorageStyle(
u'R128_TRACK_GAIN'
Expand All @@ -2040,17 +2031,8 @@ def update(self, dict):
MP3DescStorageStyle(
u'r128_album_gain'
),
MP3SoundCheckStorageStyle(
key='COMM',
index=0, desc=u'iTunR128A',
id3_lang='eng'
),
MP4StorageStyle(
'----:com.apple.iTunes:r128_album_gain'
),
MP4SoundCheckStorageStyle(
'----:com.apple.iTunes:iTunR128A',
index=0
'com.apple.iTunes:r128_album_gain'
),
StorageStyle(
u'R128_ALBUM_GAIN'
Expand Down
9 changes: 8 additions & 1 deletion beetsplug/replaygain.py
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,14 @@ def handle_album(self, album, write):

self._log.info(u'analyzing {0}', album)

if self.should_use_r128(album.items()[0]):
if (any([self.should_use_r128(item) for item in album.items()]) and
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)
)

if any([self.should_use_r128(item) for item in album.items()]):
if self.r128_backend_instance == '':
self.init_r128_backend()
backend_instance = self.r128_backend_instance
Expand Down

0 comments on commit 13eca81

Please sign in to comment.