rekordbox_set_list_manager.services.track_matcher#

Multi-strategy track matcher: links Spotify tracks to local Rekordbox files.

Classes#

MatchStrategy

Strategy used when matching a streaming track to a local collection entry.

MatchResult

Result of matching one Spotify track against a local collection.

TrackMatcher

Match a list of Spotify tracks against a local (Rekordbox) collection.

Module Contents#

class rekordbox_set_list_manager.services.track_matcher.MatchStrategy[source]#

Bases: enum.Enum

Strategy used when matching a streaming track to a local collection entry.

ISRC[source]#
EXACT[source]#
FUZZY[source]#
FILENAME[source]#
NONE[source]#
class rekordbox_set_list_manager.services.track_matcher.MatchResult[source]#

Result of matching one Spotify track against a local collection.

spotify_track: rekordbox_set_list_manager.models.track.Track[source]#
local_track: rekordbox_set_list_manager.models.track.Track | None[source]#
strategy: MatchStrategy[source]#
score: float[source]#
class rekordbox_set_list_manager.services.track_matcher.TrackMatcher[source]#

Match a list of Spotify tracks against a local (Rekordbox) collection.

Strategies are tried in priority order: 1. ISRC exact match 2. Artist + title exact match (case-insensitive) 3. Fuzzy title+artist match (thefuzz token_sort_ratio ≥ threshold) 4. Filename-based match (parse stem as “Artist - Title”)

FUZZY_THRESHOLD = 85[source]#
match(spotify_tracks, collection)[source]#

Return one MatchResult per spotify track.

Parameters:
  • spotify_tracks (list[Track]) – Tracks imported from Spotify (or another streaming service) to match.

  • collection (list[Track]) – The local Rekordbox collection to match against.

Returns:

One result per input track, in the same order as spotify_tracks.

Return type:

list[MatchResult]