From 50bab4e951423a611fe33f6d94498d948cab4da6 Mon Sep 17 00:00:00 2001 From: Jesse Bannon Date: Tue, 23 Jul 2024 18:48:10 -0700 Subject: [PATCH 1/2] POPM (popularity meter) tag support --- mediafile.py | 7 +++++++ test/test_mediafile.py | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/mediafile.py b/mediafile.py index a5ec5e5..eb74e33 100644 --- a/mediafile.py +++ b/mediafile.py @@ -1881,6 +1881,13 @@ def as_dict(self): ASFStorageStyle('TotalDiscs'), out_type=int, ) + popm = MediaField( + MP3StorageStyle('POPM'), + MP4StorageStyle('POPM'), + StorageStyle('POPM'), + ASFStorageStyle('Popm'), + out_type=int + ) url = MediaField( MP3DescStorageStyle(key='WXXX', attr='url', multispec=False), diff --git a/test/test_mediafile.py b/test/test_mediafile.py index 8105983..60baae7 100644 --- a/test/test_mediafile.py +++ b/test/test_mediafile.py @@ -1114,7 +1114,8 @@ def test_known_fields(self): ('encoder', 'images', 'genres', 'albumtype', 'artists', 'albumartists', 'url', 'mb_artistids', 'mb_albumartistids', 'albumtypes', 'catalognums', 'languages', 'artists_credit', - 'artists_sort', 'albumartists_credit', 'albumartists_sort') + 'artists_sort', 'albumartists_credit', 'albumartists_sort', + 'popm') ) assertCountEqual(self, MediaFile.fields(), fields) From fd60bdbc0655a783cf82421a054e89fafae0a52f Mon Sep 17 00:00:00 2001 From: Jesse Bannon Date: Wed, 24 Jul 2024 09:13:53 -0700 Subject: [PATCH 2/2] mp4 as_type int --- mediafile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediafile.py b/mediafile.py index eb74e33..c708aa0 100644 --- a/mediafile.py +++ b/mediafile.py @@ -1883,7 +1883,7 @@ def as_dict(self): ) popm = MediaField( MP3StorageStyle('POPM'), - MP4StorageStyle('POPM'), + MP4StorageStyle('POPM', as_type=int), StorageStyle('POPM'), ASFStorageStyle('Popm'), out_type=int