diff --git a/api/funkwhale_api/music/metadata.py b/api/funkwhale_api/music/metadata.py index 6740bd4f3..4bdf04dde 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 121fef4b2..521850e9a 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 000000000..1b92b5cbb 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 000000000..648e28093 --- /dev/null +++ b/changes/changelog.d/opus-cover.bugfix @@ -0,0 +1 @@ +Fixed album art not being retrieved from Ogg/Opus files