Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add composer_sort as a tag #2529

Merged
merged 9 commits into from
May 12, 2017
2 changes: 0 additions & 2 deletions beets/autotag/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ def apply_item_metadata(item, track_info):
item.composer_sort = track_info.composer_sort
if track_info.arranger is not None:
item.arranger = track_info.arranger



# At the moment, the other metadata is left intact (including album
# and track number). Perhaps these should be emptied?
Expand Down
2 changes: 1 addition & 1 deletion beets/autotag/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def __init__(self, title, track_id, artist=None, artist_id=None,
length=None, index=None, medium=None, medium_index=None,
medium_total=None, artist_sort=None, disctitle=None,
artist_credit=None, data_source=None, data_url=None,
media=None, lyricist=None, composer=None, composer_sort=None,
media=None, lyricist=None, composer=None, composer_sort=None,
arranger=None, track_alt=None):
self.title = title
self.track_id = track_id
Expand Down
4 changes: 0 additions & 4 deletions beets/mediafile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1632,28 +1632,24 @@ def update(self, dict):
StorageStyle('LYRICIST'),
ASFStorageStyle('WM/Writer'),
)

composer = MediaField(
MP3StorageStyle('TCOM'),
MP4StorageStyle('\xa9wrt'),
StorageStyle('COMPOSER'),
ASFStorageStyle('WM/Composer'),
)

composer_sort = MediaField(
MP3StorageStyle('TSOC'),
MP4StorageStyle('soco'),
StorageStyle('COMPOSERSORT'),
ASFStorageStyle('WM/Composersortorder'),
)

arranger = MediaField(
MP3PeopleStorageStyle('TIPL', involvement='arranger'),
MP4StorageStyle('----:com.apple.iTunes:Arranger'),
StorageStyle('ARRANGER'),
ASFStorageStyle('beets/Arranger'),
)

grouping = MediaField(
MP3StorageStyle('TIT1'),
MP4StorageStyle('\xa9grp'),
Expand Down
24 changes: 0 additions & 24 deletions test/test_mediafile.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,6 @@ def test_add_image_structure(self):
type=ImageType.composer)
mediafile.images += [image]
mediafile.save()

image = Image(data=self.png_data, desc=u'the sortname of the composer',
type=ImageType.composer_sort)
mediafile.images += [image]
mediafile.save()


mediafile = MediaFile(mediafile.path)
self.assertEqual(len(mediafile.images), 3)
Expand All @@ -156,12 +150,6 @@ def test_add_image_structure(self):
self.assertExtendedImageAttributes(
image, desc=u'the composer', type=ImageType.composer
)

images = (i for i in mediafile.images if i.desc == u'the sortname of the composer')
image = next(images, None)
self.assertExtendedImageAttributes(
image, desc=u'the sortname of the composer', type=ImageType.composer_sort
)

def test_delete_image_structures(self):
mediafile = self._mediafile_fixture('image')
Expand Down Expand Up @@ -205,11 +193,6 @@ def test_add_tiff_image(self):
type=ImageType.composer)
mediafile.images += [image]
mediafile.save()

image = Image(data=self.tiff_data, desc=u'the sortname of the composer',
type=ImageType.composer_sort)
mediafile.images += [image]
mediafile.save()

mediafile = MediaFile(mediafile.path)
self.assertEqual(len(mediafile.images), 3)
Expand All @@ -219,11 +202,6 @@ def test_add_tiff_image(self):
mediafile.images))[0]
self.assertExtendedImageAttributes(
image, desc=u'the composer', type=ImageType.composer)

image = list(filter(lambda i: i.mime_type == 'image/tiff',
mediafile.images))[0]
self.assertExtendedImageAttributes(
image, desc=u'the sortname of the composer', type=ImageType.composer_sort)


class LazySaveTestMixin(object):
Expand Down Expand Up @@ -345,7 +323,6 @@ class ReadWriteTestBase(ArtTestMixin, GenreListTestMixin,
'album': u'the album',
'genre': u'the genre',
'composer': u'the composer',
'composer_sort': u'the sortname of the composer',
'grouping': u'the grouping',
'year': 2001,
'month': None,
Expand Down Expand Up @@ -373,7 +350,6 @@ class ReadWriteTestBase(ArtTestMixin, GenreListTestMixin,
'genre',
'lyricist',
'composer',
'composer_sort',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This list does have an artist_sort, so the composer_sort is probably also applicable here.

'arranger',
'grouping',
'year',
Expand Down