Commit 699df289 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Merge branch '946-m4a-no-cover' into 'master'

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

See merge request !928
parents 90d8e3d8 66ef7a73
......@@ -72,7 +72,7 @@ def clean_id3_pictures(apic):
def get_mp4_tag(f, k):
if k == "pictures":
return f.get("covr")
return f.get("covr", [])
raw_value = f.get(k, None)
if not raw_value:
......
......@@ -219,6 +219,11 @@ def test_can_get_metadata_from_m4a_file(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():
path = os.path.join(DATA_DIR, "sample.flac")
data = metadata.Metadata(path)
......
Fix import crash when importing M4A file with no embedded cover (#946)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment