Skip to content

Add usdb_matcher cli tool#477

Open
BenPortner wants to merge 1 commit intobohning:mainfrom
BenPortner:usdb_matcher
Open

Add usdb_matcher cli tool#477
BenPortner wants to merge 1 commit intobohning:mainfrom
BenPortner:usdb_matcher

Conversation

@BenPortner
Copy link

@BenPortner BenPortner commented Oct 15, 2025

This PR adds a CLI tool, which scans local song folders and tries to match them with USDB entries based on the "artist", "title" and "creator" fields of the txt file. If a unique match is found, it will write a synchronization file to the song folder.

Motivation

usdb_syncer is an amazing tool and I would like to use it to manage my existing song collection. Because a large part of the collection was created prior to usdb_syncer, most songs are missing .usdb synchronization files. This tool helps by scanning a local collection, matching songs with USDB entries based on metadata, and writing out .usdb files if a unique match was found.

Note

  • The code contains a fix to the normalize function that might be worth adding to the main code base
  • It might be worthwhile adding sync_meta_from_textfile as a factory function to the SyncMeta class
  • The header parser strips "[DUET]" from all titles. This makes it impossible to match duet songs exactly. The current workaround is to use find_similar_usdb_songs as a fallback. Although this seems to work quite reliably, I can imagine there are edge cases where this leads to unwanted matches
  • The tool currently discards songs, for which more than one match was found. This usually happens if there is more than one version (e.g. album version and radio version). One could add an interactive mode to let the user choose the correct match in such a case.

@RumovZ
Copy link
Collaborator

RumovZ commented Oct 17, 2025

Seems like this would work really well as an add-on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants