Spaces:
Running
Running
Z User commited on
Commit ·
59763d4
1
Parent(s): ad34132
NetMirror: Add fuzzy title matching for better results
Browse files971 unmodified lines972973974975976977978977979980981982983984985986987988989990991992993994995996997971 unmodified lines return service_results, [f"{svc_name}: Search returned non-JSON"]
search_results = search_data.get("searchResult", []) # Fuzzy match: exact first, then starts-with, then contains match = None title_lower = title.lower() for item in search_results: if item.get("t", "").strip().lower() == title.lower(): item_title = item.get("t", "").strip().lower() if item_title == title_lower: match = item break if not match: for item in search_results: item_title = item.get("t", "").strip().lower() if item_title.startswith(title_lower) or title_lower.startswith(item_title): match = item break if not match: for item in search_results: item_title = item.get("t", "").strip().lower() if title_lower in item_title or item_title in title_lower: match = item break
if not match or not match.get("id"): return service_results, [f"{svc_name}: No match found"]main.py+16-1