beets/docs/plugins/deezer.rst
Šarūnas Nejus 455d620ae0
Fix data source penalty application logic
The data_source penalty was not being calculated correctly because
`_get_distance` was being called for **all** enabled metadata plugins
which eventually meant that matches were being penalised needlessly.

This commit refactors the distance calculation to:
- Remove the plugin-based track_distance() and album_distance() methods
  that were applying penalties incorrectly
- Calculate data_source penalties directly in track_distance() and
  distance() functions when sources don't match
- Use a centralized get_penalty() function to retrieve plugin-specific
  penalty values via a registry with O(1) lookup
- Change default data_source_penalty from 0.0 to 0.5 to ensure
  mismatches are penalized by default
- Add data_source to get_most_common_tags() to determine the likely
  original source for comparison

This ensures that tracks and albums from different data sources are
properly penalized during matching, improving match quality and
preventing cross-source matches.
2025-10-10 20:36:33 +01:00

51 lines
1.5 KiB
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Deezer Plugin
=============
The ``deezer`` plugin provides metadata matches for the importer using the
Deezer_ Album_ and Track_ APIs.
.. _album: https://developers.deezer.com/api/album
.. _deezer: https://www.deezer.com
.. _track: https://developers.deezer.com/api/track
Basic Usage
-----------
First, enable the ``deezer`` plugin (see :ref:`using-plugins`).
You can enter the URL for an album or song on Deezer at the ``enter Id`` prompt
during import:
::
Enter search, enter Id, aBort, eDit, edit Candidates, plaY? i
Enter release ID: https://www.deezer.com/en/album/572261
Configuration
-------------
This plugin can be configured like other metadata source plugins as described in
:ref:`metadata-source-plugin-configuration`.
Default
~~~~~~~
.. code-block:: yaml
deezer:
data_source_mismatch_penalty: 0.5
search_limit: 5
search_query_ascii: no
- **search_query_ascii**: If set to ``yes``, the search query will be converted
to ASCII before being sent to Deezer. Converting searches to ASCII can enhance
search results in some cases, but in general, it is not recommended. For
instance ``artist:deadmau5 album:4×4`` will be converted to ``artist:deadmau5
album:4x4`` (notice ``×!=x``). Default: ``no``.
The ``deezer`` plugin provides an additional command ``deezerupdate`` to update
the ``rank`` information from Deezer. The ``rank`` (ranges from 0 to 1M) is a
global indicator of a song's popularity on Deezer that is updated daily based on
streams. The higher the ``rank``, the more popular the track is.