beetbox / pyacoustid

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

Support the track/list_by_mbid API route #57

Open jbosboom opened 4 years ago

jbosboom commented 4 years ago

Implements #56.

There's not much structure to the returned data so this function parses the response itself instead of having a separate parse function.

I copied the error-raising code from submit. Maybe that should be folded into _api_request?

AcoustIDs can be disabled (soft-deleted). When the caller asks to include the disabled ids with disabled=True we return a pair of lists instead of a list of (id, disabled) pairs. Neither option feels great, but I expect anyone who wants the disabled ids to treat them differently from the enabled ones, so I went with the pair of lists. I am willing to change this if you think list-of-pairs is better.

I'm not a "native" Python developer so bikeshedding and style nits are appreciated.