fixed false positive issue from fallback query
removing artist from the search introduced false positives when searching plex.
This commit is contained in:
parent
6d8185e081
commit
2b97e685dc
5 changed files with 2155 additions and 12 deletions
Binary file not shown.
|
|
@ -373,10 +373,9 @@ class PlexClient:
|
||||||
logger.warning(f"Index mismatch: cannot store original track for '{track_info.title}'")
|
logger.warning(f"Index mismatch: cannot store original track for '{track_info.title}'")
|
||||||
return tracks
|
return tracks
|
||||||
|
|
||||||
# --- Stage 3: Title-Only Fallback Search ---
|
# --- Stage 3: Title-Only Fallback REMOVED ---
|
||||||
logger.debug(f"Stage 3: Performing title-only search for '{title}'")
|
# Removed to prevent false positives where tracks with same title
|
||||||
stage3_results = self.music_library.searchTracks(title=title, limit=limit)
|
# but different artists are incorrectly matched
|
||||||
add_candidates(stage3_results)
|
|
||||||
|
|
||||||
tracks = [PlexTrackInfo.from_plex_track(track) for track in candidate_tracks[:limit]]
|
tracks = [PlexTrackInfo.from_plex_track(track) for track in candidate_tracks[:limit]]
|
||||||
|
|
||||||
|
|
|
||||||
2150
logs/app.log
2150
logs/app.log
File diff suppressed because it is too large
Load diff
Binary file not shown.
|
|
@ -240,14 +240,8 @@ class PlaylistTrackAnalysisWorker(QRunnable):
|
||||||
return match_result.plex_track, match_result.confidence
|
return match_result.plex_track, match_result.confidence
|
||||||
|
|
||||||
# --- Final Fallback: Title-only search if no artist-based match was found ---
|
# --- Final Fallback: Title-only search if no artist-based match was found ---
|
||||||
if not all_potential_matches:
|
# Removed title-only fallback to prevent false positives
|
||||||
print(f"🎤 No artist-based matches found. Performing final title-only fallback for '{original_title}'")
|
# A track by a different artist is NOT the same track
|
||||||
for query_title in unique_title_variations:
|
|
||||||
title_only_matches = self.plex_client.search_tracks(title=query_title, artist="", limit=10)
|
|
||||||
for track in title_only_matches:
|
|
||||||
if track.id not in found_match_ids:
|
|
||||||
all_potential_matches.append(track)
|
|
||||||
found_match_ids.add(track.id)
|
|
||||||
|
|
||||||
if not all_potential_matches:
|
if not all_potential_matches:
|
||||||
print(f"❌ No Plex candidates found for '{original_title}' after all strategies.")
|
print(f"❌ No Plex candidates found for '{original_title}' after all strategies.")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue