calliope.resolvers

Select Musicbrainz matches for playlist items by weighted priorities

Module Contents

Functions

select_best(item, candidates)

Automatically select the best match Item from a list of candidates for a given item.

select_interactive(item, candidates)

Select the best match Item from a list of candidates for a given item,

calliope.resolvers.select_best(item, candidates)

Automatically select the best match Item from a list of candidates for a given item.

For each candidate, a number of weighted priorities is computed, which comprise its overall priority. The item with the best priority is automatically selected if it is higher than 90%.

Parameters:
  • item (calliope.playlist.Item) – A calliope playlist item to match

  • candidates (List[calliope.playlist.Item]) – A list of candidates

Returns:

The best match Item or None if no good match was found.

Return type:

Optional[calliope.playlist.Item]

calliope.resolvers.select_interactive(item, candidates)

Select the best match Item from a list of candidates for a given item, with asking the user for help if in doubt.

For each candidate, a number of weighted priorities is computed, which comprise its overall priority. The item with the best priority is automatically selected if it is higher than 95%, otherwise the user is asked for help.

Parameters:
  • item (calliope.playlist.Item) – A calliope playlist item to match

  • candidates (List[calliope.playlist.Item]) – A list of candidates

Returns:

The best match Item or None if no good match was found.

Return type:

Optional[calliope.playlist.Item]