diff --git a/beets/library.py b/beets/library.py index 8965dd6dd..e70cee63b 100644 --- a/beets/library.py +++ b/beets/library.py @@ -41,32 +41,34 @@ ITEM_FIELDS = [ ('path', 'blob', False, False), ('album_id', 'int', False, False), - ('title', 'text', True, True), - ('artist', 'text', True, True), - ('artist_sort', 'text', True, True), - ('album', 'text', True, True), - ('albumartist', 'text', True, True), - ('albumartist_sort', 'text', True, True), - ('genre', 'text', True, True), - ('composer', 'text', True, True), - ('grouping', 'text', True, True), - ('year', 'int', True, True), - ('month', 'int', True, True), - ('day', 'int', True, True), - ('track', 'int', True, True), - ('tracktotal', 'int', True, True), - ('disc', 'int', True, True), - ('disctotal', 'int', True, True), - ('lyrics', 'text', True, True), - ('comments', 'text', True, True), - ('bpm', 'int', True, True), - ('comp', 'bool', True, True), - ('mb_trackid', 'text', True, True), - ('mb_albumid', 'text', True, True), - ('mb_artistid', 'text', True, True), - ('mb_albumartistid', 'text', True, True), - ('albumtype', 'text', True, True), - ('label', 'text', True, True), + ('title', 'text', True, True), + ('artist', 'text', True, True), + ('artist_sort', 'text', True, True), + ('album', 'text', True, True), + ('albumartist', 'text', True, True), + ('albumartist_sort', 'text', True, True), + ('genre', 'text', True, True), + ('composer', 'text', True, True), + ('grouping', 'text', True, True), + ('year', 'int', True, True), + ('month', 'int', True, True), + ('day', 'int', True, True), + ('track', 'int', True, True), + ('tracktotal', 'int', True, True), + ('disc', 'int', True, True), + ('disctotal', 'int', True, True), + ('lyrics', 'text', True, True), + ('comments', 'text', True, True), + ('bpm', 'int', True, True), + ('comp', 'bool', True, True), + ('mb_trackid', 'text', True, True), + ('mb_albumid', 'text', True, True), + ('mb_artistid', 'text', True, True), + ('mb_albumartistid', 'text', True, True), + ('albumtype', 'text', True, True), + ('label', 'text', True, True), + ('acoustid_fingerprint', 'text', True, True), + ('acoustid_id', 'text', True, True), ('length', 'real', False, True), ('bitrate', 'int', False, True), diff --git a/beets/mediafile.py b/beets/mediafile.py index f114fba10..a6fcbb64e 100644 --- a/beets/mediafile.py +++ b/beets/mediafile.py @@ -932,6 +932,24 @@ class MediaFile(object): etc = StorageStyle('musicbrainz_albumartistid') ) + # Acoustid fields. + acoustid_fingerprint = MediaField( + mp3 = StorageStyle('TXXX', + id3_desc=u'Acoustid Fingerprint'), + mp4 = StorageStyle( + '----:com.apple.iTunes:Acoustid Fingerprint', + as_type=str), + etc = StorageStyle('ACOUSTID_FINGERPRINT') + ) + acoustid_id = MediaField( + mp3 = StorageStyle('TXXX', + id3_desc=u'Acoustid Id'), + mp4 = StorageStyle( + '----:com.apple.iTunes:Acoustid Id', + as_type=str), + etc = StorageStyle('ACOUSTID_ID') + ) + # ReplayGain fields. rg_track_gain = FloatValueField(2, 'dB', mp3 = StorageStyle('TXXX', diff --git a/docs/reference/pathformat.rst b/docs/reference/pathformat.rst index 916ccd0b4..35d798863 100644 --- a/docs/reference/pathformat.rst +++ b/docs/reference/pathformat.rst @@ -148,9 +148,11 @@ Audio information: * bitdepth (only available for some formats) * samplerate (in kilohertz, with units: e.g., "48kHz") -MusicBrainz IDs: +MusicBrainz and fingerprint information: * mb_trackid * mb_albumid * mb_artistid * mb_albumartistid +* acoustid_fingerprint +* acoustid_id diff --git a/test/test_mediafile_basic.py b/test/test_mediafile_basic.py index 6651233dd..8131e2c1e 100644 --- a/test/test_mediafile_basic.py +++ b/test/test_mediafile_basic.py @@ -223,10 +223,12 @@ correct_dicts = { 'label': u'', # Additional, non-iTunes fields. - 'albumartist': u'', - 'mb_albumartistid': u'', - 'artist_sort': u'', - 'albumartist_sort': u'', + 'albumartist': u'', + 'mb_albumartistid': u'', + 'artist_sort': u'', + 'albumartist_sort': u'', + 'acoustid_fingerprint': u'', + 'acoustid_id': u'', }, # Full release date.