Skip to content

Batched matching in collection #92

@semohr

Description

@semohr

We currently supports matching only a single track to a collection or library at a time via the match method in collection.py. This requires iterative calls for multiple tracks, which is inefficient for users starting with batches of tracks from playlists or libraries.

To address this, add support for batch matching multiple tracks in a single operation, such as a new match_tracks method that accepts a list of tracks. This would streamline syncing larger sets across music services and leverage batched lookup APIs (like those by track ID from Apple Music or Spotify) for better performance, with fallbacks to individual calls where needed.

Needs a bit of thought but changing the current api to something like this could work:

# Before: Loop over tracks
for track in tracks:
    collection.match_track(track)

# After: Single batch call
collection.match_tracks(tracks)

code ref

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions