diff --git a/docs/index.rst b/docs/index.rst index f410401..9ad829a 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -135,6 +135,11 @@ To copy tags from one MediaFile to another: Changelog --------- +v0.11.1 +''''''' +- Add the multiple-valued properties ``artists_credit``, ``artists_sort``, + ``albumartists_credit``, and ``albumartists_sort``. + v0.11.0 ''''''' diff --git a/mediafile.py b/mediafile.py index 4f763a0..a5ec5e5 100644 --- a/mediafile.py +++ b/mediafile.py @@ -2101,12 +2101,36 @@ def as_dict(self): StorageStyle('ARTIST_CREDIT'), ASFStorageStyle('beets/Artist Credit'), ) + artists_credit = ListMediaField( + MP3ListDescStorageStyle(desc=u'ARTISTS_CREDIT'), + MP4ListStorageStyle('----:com.apple.iTunes:ARTISTS_CREDIT'), + ListStorageStyle('ARTISTS_CREDIT'), + ASFStorageStyle('beets/ArtistsCredit'), + ) + artists_sort = ListMediaField( + MP3ListDescStorageStyle(desc=u'ARTISTS_SORT'), + MP4ListStorageStyle('----:com.apple.iTunes:ARTISTS_SORT'), + ListStorageStyle('ARTISTS_SORT'), + ASFStorageStyle('beets/ArtistsSort'), + ) albumartist_credit = MediaField( MP3DescStorageStyle(u'Album Artist Credit'), MP4StorageStyle('----:com.apple.iTunes:Album Artist Credit'), StorageStyle('ALBUMARTIST_CREDIT'), ASFStorageStyle('beets/Album Artist Credit'), ) + albumartists_credit = ListMediaField( + MP3ListDescStorageStyle(desc=u'ALBUMARTISTS_CREDIT'), + MP4ListStorageStyle('----:com.apple.iTunes:ALBUMARTISTS_CREDIT'), + ListStorageStyle('ALBUMARTISTS_CREDIT'), + ASFStorageStyle('beets/AlbumArtistsCredit'), + ) + albumartists_sort = ListMediaField( + MP3ListDescStorageStyle(desc=u'ALBUMARTISTS_SORT'), + MP4ListStorageStyle('----:com.apple.iTunes:ALBUMARTISTS_SORT'), + ListStorageStyle('ALBUMARTISTS_SORT'), + ASFStorageStyle('beets/AlbumArtistsSort'), + ) # Legacy album art field art = CoverArtField() diff --git a/test/test_mediafile.py b/test/test_mediafile.py index fa474bd..8105983 100644 --- a/test/test_mediafile.py +++ b/test/test_mediafile.py @@ -715,7 +715,10 @@ def _generate_tags(self, base=None): for key in ['disc', 'disctotal', 'track', 'tracktotal', 'bpm']: tags[key] = 1 - for key in ['artists', 'albumartists']: + for key in [ + 'artists', 'albumartists', 'artists_credit', + 'albumartists_credit', 'artists_sort', 'albumartists_sort' + ]: tags[key] = ['multival', 'test'] tags['art'] = self.jpg_data @@ -1110,7 +1113,8 @@ def test_known_fields(self): fields.extend( ('encoder', 'images', 'genres', 'albumtype', 'artists', 'albumartists', 'url', 'mb_artistids', 'mb_albumartistids', - 'albumtypes', 'catalognums', 'languages') + 'albumtypes', 'catalognums', 'languages', 'artists_credit', + 'artists_sort', 'albumartists_credit', 'albumartists_sort') ) assertCountEqual(self, MediaFile.fields(), fields)