beetbox / pyacoustid

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

parse_lookup_result throws WebServiceError when no results exist #2

Closed alastair closed 12 years ago

alastair commented 12 years ago

I expected WebServiceError to only be thrown when there is an issue with the lookup on the server. To me, the fact that there's no matching track doesn't feel like an exceptional case, let alone a problem with the webservice.

I would expect either a NoResults exception to be thrown, or an empty tuple.

sampsyo commented 12 years ago

Good call. I've changed the parser to iterate over all results instead of just returning the first one. This way, the "no results" case just means that an empty result set will be returned.