Fix #946: Fix import crash when importing M4A file with no embedded cover
This commit is contained in:
parent
db80710160
commit
66ef7a7332
|
@ -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)
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Fix import crash when importing M4A file with no embedded cover (#946)
|
Loading…
Reference in New Issue