Find & Add on the playlist-sync page only wrote sync_match_cache, which is DELETEd wholesale after every DB scan — so the source->library pairing (and the user's manual matches) reverted to 'extra'/red-dot on the next shallow scan. The three match stores (sync_match_cache, manual_library_track_matches, discovery extra_data) were disconnected and all pointed at tracks.id, which a rescan re-keys (esp. Jellyfin/Navidrome GUIDs). Unify the match so it's one durable fact, recorded once, honored everywhere: - Find & Add also writes a durable manual_library_track_matches row (one-way; the manual-match tool has no playlist to act on, so no reverse). Carries the library file path. - New library_file_path column (idempotent migration) + find_track_id_by_file_path: re-resolve a stale library_track_id after a rescan re-keys the track, and self-heal the row. - The sync compare display's override lookup now falls back to the durable manual match (resolve_durable_match_server_id) when sync_match_cache misses — so the pairing persists across a scan instead of reverting to a red dot. Purely additive: only adds matches when the cache returns nothing. Tests: durable resolver (valid / stale-reresolve+self-heal / no-match / not-in- playlist / missing-methods), file_path persistence + find_track_id_by_file_path. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| music_database.py | ||
| personalized_schema.py | ||