Support for recommendations in Mopidy-Listenbrainz

Ah, ok. For this situation exists another workflow:

  1. Fetch the metadata (its included in the JSPF file!) if needed, so that you have the artist/release and track name.
  2. Build an index of all available (to play) tracks, fetching their artist and track name.
  3. Use the fuzzy index (super fast to build, even faster to query) to try and find local matches based on both MBIDs and metadata if the MBIDs do not resolve.

Troi does this for resolving playlists to a local collection – its essentially exactly the same workflow and it works quite well!

Here is the fuzzy index, but do take a look at the code in the content resolver directory, since other bits might be useful for you:

troi-recommendation-playground/troi/content_resolver/fuzzy_index.py at main · metabrainz/troi-recommendation-playground · GitHub

Does that meet what you need?