Skip to content
Snippets Groups Projects
Verified Commit 66ef7a73 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Fix #946: Fix import crash when importing M4A file with no embedded cover

parent db807101
Branches
No related tags found
No related merge requests found
...@@ -72,7 +72,7 @@ def clean_id3_pictures(apic): ...@@ -72,7 +72,7 @@ def clean_id3_pictures(apic):
def get_mp4_tag(f, k): def get_mp4_tag(f, k):
if k == "pictures": if k == "pictures":
return f.get("covr") return f.get("covr", [])
raw_value = f.get(k, None) raw_value = f.get(k, None)
if not raw_value: if not raw_value:
......
...@@ -219,6 +219,11 @@ def test_can_get_metadata_from_m4a_file(field, value): ...@@ -219,6 +219,11 @@ def test_can_get_metadata_from_m4a_file(field, value):
assert data.get(field) == value assert data.get(field) == value
def test_get_pictures_m4a_empty():
pictures = metadata.get_mp4_tag({}, "pictures")
assert metadata.clean_mp4_pictures(pictures) == []
def test_can_get_metadata_from_flac_file_not_crash_if_empty(): def test_can_get_metadata_from_flac_file_not_crash_if_empty():
path = os.path.join(DATA_DIR, "sample.flac") path = os.path.join(DATA_DIR, "sample.flac")
data = metadata.Metadata(path) data = metadata.Metadata(path)
......
Fix import crash when importing M4A file with no embedded cover (#946)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment