Closed sdobz closed 12 years ago
In acoustid.py line 224: if recording['artists']:
if recording['artists']:
generates a KeyError if there is no artist returned?
The results table is given here: {u'id': u'cd7a97ce-bdd8-4e7e-9399-b8d02ffc15a2'}
I changed it to: if 'artists' in recording:
if 'artists' in recording:
Since the result also did not have a title I had to add the lines: if 'title' in recording: title = recording['title'] else: title = None
if 'title' in recording: title = recording['title'] else: title = None
As well as change the return to: yield score, recording['id'], title, artist_name
yield score, recording['id'], title, artist_name
and it seems to be working.
The above is a slightly different fix, using dict.get.
dict.get
In acoustid.py line 224:
if recording['artists']:
generates a KeyError if there is no artist returned?
The results table is given here: {u'id': u'cd7a97ce-bdd8-4e7e-9399-b8d02ffc15a2'}
I changed it to:
if 'artists' in recording:
Since the result also did not have a title I had to add the lines:
if 'title' in recording: title = recording['title'] else: title = None
As well as change the return to:
yield score, recording['id'], title, artist_name
and it seems to be working.