mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 09:39:17 +02:00
Importer will now pick embedded images in files with OTHER type if no COVER_FRONT is present
This commit is contained in:
parent
11728bbbc4
commit
4a3c21a094
5 changed files with 20 additions and 8 deletions
|
@ -147,14 +147,16 @@ def test_can_get_metadata_from_id3_mp3_file(field, value):
|
|||
assert data.get(field) == value
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name", ["test.mp3", "sample.flac", "with_cover.ogg"])
|
||||
@pytest.mark.parametrize(
|
||||
"name", ["test.mp3", "with_other_picture.mp3", "sample.flac", "with_cover.ogg"]
|
||||
)
|
||||
def test_can_get_pictures(name):
|
||||
path = os.path.join(DATA_DIR, name)
|
||||
data = metadata.Metadata(path)
|
||||
|
||||
pictures = data.get("pictures")
|
||||
assert len(pictures) == 1
|
||||
cover_data = data.get_picture("cover_front")
|
||||
cover_data = data.get_picture("cover_front", "other")
|
||||
assert cover_data["mimetype"].startswith("image/")
|
||||
assert len(cover_data["content"]) > 0
|
||||
assert type(cover_data["content"]) == bytes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue