mediafile: add lower-case RG ID3 tags

This commit is contained in:
Adrian Sampson 2013-10-20 13:31:39 -07:00
parent 2d2836825f
commit 6ddb296c87
2 changed files with 43 additions and 18 deletions

View file

@ -1279,22 +1279,32 @@ class MediaFile(object):
# ReplayGain fields.
rg_track_gain = MediaField(out_type=float,
mp3=[StorageStyle('TXXX', id3_desc=u'REPLAYGAIN_TRACK_GAIN',
float_places=2, suffix=u' dB'),
StorageStyle('COMM', id3_desc=u'iTunNORM', id3_lang='eng',
packing=packing.SC, pack_pos=0, pack_type=float)],
mp4=[StorageStyle('----:com.apple.iTunes:replaygain_track_gain',
as_type=str, float_places=2, suffix=b' dB'),
StorageStyle('----:com.apple.iTunes:iTunNORM',
packing=packing.SC, pack_pos=0, pack_type=float)],
mp3=[
StorageStyle('TXXX', id3_desc=u'REPLAYGAIN_TRACK_GAIN',
float_places=2, suffix=u' dB'),
StorageStyle('TXXX', id3_desc=u'replaygain_track_gain',
float_places=2, suffix=u' dB'),
StorageStyle('COMM', id3_desc=u'iTunNORM', id3_lang='eng',
packing=packing.SC, pack_pos=0, pack_type=float),
],
mp4=[
StorageStyle('----:com.apple.iTunes:replaygain_track_gain',
as_type=str, float_places=2, suffix=b' dB'),
StorageStyle('----:com.apple.iTunes:iTunNORM',
packing=packing.SC, pack_pos=0, pack_type=float),
],
etc=StorageStyle(u'REPLAYGAIN_TRACK_GAIN',
float_places=2, suffix=u' dB'),
asf=StorageStyle(u'replaygain_track_gain',
float_places=2, suffix=u' dB'),
)
rg_album_gain = MediaField(out_type=float,
mp3=StorageStyle('TXXX', id3_desc=u'REPLAYGAIN_ALBUM_GAIN',
mp3=[
StorageStyle('TXXX', id3_desc=u'REPLAYGAIN_ALBUM_GAIN',
float_places=2, suffix=u' dB'),
StorageStyle('TXXX', id3_desc=u'replaygain_album_gain',
float_places=2, suffix=u' dB'),
],
mp4=StorageStyle('----:com.apple.iTunes:replaygain_album_gain',
as_type=str, float_places=2, suffix=b' dB'),
etc=StorageStyle(u'REPLAYGAIN_ALBUM_GAIN',
@ -1303,22 +1313,32 @@ class MediaFile(object):
float_places=2, suffix=u' dB'),
)
rg_track_peak = MediaField(out_type=float,
mp3=[StorageStyle('TXXX', id3_desc=u'REPLAYGAIN_TRACK_PEAK',
float_places=6),
StorageStyle('COMM', id3_desc=u'iTunNORM', id3_lang='eng',
packing=packing.SC, pack_pos=1, pack_type=float)],
mp4=[StorageStyle('----:com.apple.iTunes:replaygain_track_peak',
as_type=str, float_places=6),
StorageStyle('----:com.apple.iTunes:iTunNORM',
packing=packing.SC, pack_pos=1, pack_type=float)],
mp3=[
StorageStyle('TXXX', id3_desc=u'REPLAYGAIN_TRACK_PEAK',
float_places=6),
StorageStyle('TXXX', id3_desc=u'replaygain_track_peak',
float_places=6),
StorageStyle('COMM', id3_desc=u'iTunNORM', id3_lang='eng',
packing=packing.SC, pack_pos=1, pack_type=float),
],
mp4=[
StorageStyle('----:com.apple.iTunes:replaygain_track_peak',
as_type=str, float_places=6),
StorageStyle('----:com.apple.iTunes:iTunNORM',
packing=packing.SC, pack_pos=1, pack_type=float),
],
etc=StorageStyle(u'REPLAYGAIN_TRACK_PEAK',
float_places=6),
asf=StorageStyle(u'replaygain_track_peak',
float_places=6),
)
rg_album_peak = MediaField(out_type=float,
mp3=StorageStyle('TXXX', id3_desc=u'REPLAYGAIN_ALBUM_PEAK',
mp3=[
StorageStyle('TXXX', id3_desc=u'REPLAYGAIN_ALBUM_PEAK',
float_places=6),
StorageStyle('TXXX', id3_desc=u'replaygain_album_peak',
float_places=6),
],
mp4=StorageStyle('----:com.apple.iTunes:replaygain_album_peak',
as_type=str, float_places=6),
etc=StorageStyle(u'REPLAYGAIN_ALBUM_PEAK',

View file

@ -14,6 +14,11 @@ New features:
Little fixes:
* When writing ID3 tags for ReplayGain normalization, tags are written with
both upper-case and lower-case TXXX frame descriptions. Previous versions of
beets used only the upper-case style, which seems to be more standard, but
some players (namely, Quod Libet and foobar2000) seem to only use lower-case
names.
* :doc:`/plugins/missing`: Avoid a possible error when an album's
``tracktotal`` field is missing.
* :doc:`/plugins/ftintitle`: Fix an error when the sort artist is missing.