Skip to content

Commit a2e0e71

Browse files
committed
Support for subtitle field (TIT3) (#82)
This PR adds support for a subtitle field for MP3 (ID3v2 "TIT3") and ASF. Reference for an MP4 tag missing. Required by beetbox/beets#5696
2 parents 4a0f09b + 25a0a3f commit a2e0e71

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

mediafile.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1807,6 +1807,11 @@ def as_dict(self):
18071807
StorageStyle('GROUPING'),
18081808
ASFStorageStyle('WM/ContentGroupDescription'),
18091809
)
1810+
subtitle = MediaField(
1811+
MP3StorageStyle('TIT3'),
1812+
StorageStyle('SUBTITLE'),
1813+
ASFStorageStyle('Subtitle'),
1814+
)
18101815
track = MediaField(
18111816
MP3SlashPackStorageStyle('TRCK', pack_pos=0),
18121817
MP4TupleStorageStyle('trkn', index=0),

test/test_mediafile.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,8 @@ def test_known_fields(self):
11111111
('encoder', 'images', 'genres', 'albumtype', 'artists',
11121112
'albumartists', 'url', 'mb_artistids', 'mb_albumartistids',
11131113
'albumtypes', 'catalognums', 'languages', 'artists_credit',
1114-
'artists_sort', 'albumartists_credit', 'albumartists_sort')
1114+
'artists_sort', 'albumartists_credit', 'albumartists_sort',
1115+
'subtitle')
11151116
)
11161117
self.assertCountEqual(MediaFile.fields(), fields)
11171118

0 commit comments

Comments
 (0)