beetbox / pyacoustid

Python bindings for Chromaprint acoustic fingerprinting and the Acoustid Web service
MIT License
325 stars 66 forks source link

pyacoustid crashes when artist and title are missing #12

Closed shweppsie closed 12 years ago

shweppsie commented 12 years ago

pyacoustid crashes whenever it tries to return 07a22ad2-2709-4bcb-9951-49687d099867. I suspect this is because it has been removed from MusicBrainz.

Traceback (most recent call last): File "id.py", line 11, in for i in acoustid.match(apikey, path): File "/src/pyacoustid/acoustid.py", line 206, in parse_lookup_result if recording['artists']: KeyError: 'artists'

The attached commit checks for missing information and returns None when it is unavailable, much like the existing code.

shweppsie commented 12 years ago

Nevermind, I had originally cloned from lalinsky who has an older version of the code. I've just cloned your code and can see you have already fixed this bug.