add fourth search query for enhanced matching with both a cleaned and artist removed search.
This commit is contained in:
parent
7d8bb2b88a
commit
da44278f12
1 changed files with 11 additions and 2 deletions
|
|
@ -31,7 +31,11 @@ class MusicMatchingEngine:
|
||||||
# Only remove explicit/clean markers - preserve remixes, versions, and content after hyphens
|
# Only remove explicit/clean markers - preserve remixes, versions, and content after hyphens
|
||||||
r'\s*\(explicit\)',
|
r'\s*\(explicit\)',
|
||||||
r'\s*\(clean\)',
|
r'\s*\(clean\)',
|
||||||
# Remove featuring artists from the title itself
|
# Parenthesized featuring (must come before space-based patterns)
|
||||||
|
r'\s*\(feat\.?[^)]*\)',
|
||||||
|
r'\s*\(ft\.?[^)]*\)',
|
||||||
|
r'\s*\(featuring[^)]*\)',
|
||||||
|
# Space-based featuring (catches "Title feat. Artist" without parens)
|
||||||
r'\sfeat\.?.*',
|
r'\sfeat\.?.*',
|
||||||
r'\sft\.?.*',
|
r'\sft\.?.*',
|
||||||
r'\sfeaturing.*'
|
r'\sfeaturing.*'
|
||||||
|
|
@ -501,6 +505,11 @@ class MusicMatchingEngine:
|
||||||
queries.append(f"{artist} {original_track_clean}".strip())
|
queries.append(f"{artist} {original_track_clean}".strip())
|
||||||
logger.debug(f"PRIORITY 3: Original query: '{artist} {original_track_clean}'")
|
logger.debug(f"PRIORITY 3: Original query: '{artist} {original_track_clean}'")
|
||||||
|
|
||||||
|
# PRIORITY 4: Clean title without artist (broadens results when artist name limits matches)
|
||||||
|
if original_track_clean and original_track_clean not in [q.lower() for q in queries]:
|
||||||
|
queries.append(original_track_clean)
|
||||||
|
logger.debug(f"PRIORITY 4: Title-only query: '{original_track_clean}'")
|
||||||
|
|
||||||
# Remove duplicates while preserving order
|
# Remove duplicates while preserving order
|
||||||
unique_queries = []
|
unique_queries = []
|
||||||
seen = set()
|
seen = set()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue