Skip to content
Snippets Groups Projects
Commit 0e3c2c9b authored by atenart's avatar atenart Committed by jvoisin
Browse files

libmat2: audio: not all id3 types have a text attribute


Not all id3 types have a text attribute (such as mutagen.id3.APIC or
mutagen.id3.UFID). This leads to the get_meta helper to crash when
trying to access the text attribute of an object which does not have it.
Fixes it by checking the text attribute is available before accessing
it.

Signed-off-by: default avatarAntoine Tenart <antoine.tenart@ack.tf>
parent 2dc097ba
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,8 @@ class MP3Parser(MutagenParser):
metadata = {} # type: Dict[str, Union[str, dict]]
meta = mutagen.File(self.filename).tags
for key in meta:
if not hasattr(meta[key], 'text'):
continue
metadata[key.rstrip(' \t\r\n\0')] = ', '.join(map(str, meta[key].text))
return metadata
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment