diff --git a/api/funkwhale_api/music/metadata.py b/api/funkwhale_api/music/metadata.py index 6740bd4f3913526149042acb14d73ff82b431397..4bdf04ddeeac3faf5a220ee1add5292fcde0a979 100644 --- a/api/funkwhale_api/music/metadata.py +++ b/api/funkwhale_api/music/metadata.py @@ -147,6 +147,10 @@ CONF = { "license": {}, "copyright": {}, "genre": {}, + "pictures": { + "field": "metadata_block_picture", + "to_application": clean_ogg_pictures, + }, }, }, "OggVorbis": { diff --git a/api/tests/music/test_metadata.py b/api/tests/music/test_metadata.py index 121fef4b2c9d95b58415f7e57bf8bc7b6dc14062..521850e9a6eddbfedab5c7c5ea75df48dc608a54 100644 --- a/api/tests/music/test_metadata.py +++ b/api/tests/music/test_metadata.py @@ -142,7 +142,14 @@ def test_can_get_metadata_from_id3_mp3_file(field, value): @pytest.mark.parametrize( - "name", ["test.mp3", "with_other_picture.mp3", "sample.flac", "with_cover.ogg"] + "name", + [ + "test.mp3", + "with_other_picture.mp3", + "sample.flac", + "with_cover.ogg", + "with_cover.opus", + ], ) def test_can_get_pictures(name): path = os.path.join(DATA_DIR, name) diff --git a/api/tests/music/with_cover.opus b/api/tests/music/with_cover.opus new file mode 100644 index 0000000000000000000000000000000000000000..1b92b5cbb098e47c9722c01fa9caa0700c1284f9 Binary files /dev/null and b/api/tests/music/with_cover.opus differ diff --git a/changes/changelog.d/opus-cover.bugfix b/changes/changelog.d/opus-cover.bugfix new file mode 100644 index 0000000000000000000000000000000000000000..648e280935cb0e1d278693f69f95232fc476550f --- /dev/null +++ b/changes/changelog.d/opus-cover.bugfix @@ -0,0 +1 @@ +Fixed album art not being retrieved from Ogg/Opus files