Skip to content

Two-Way Sync & Safety ​

How three-way sync works ​

tunesync sync works like a Git three-way merge for each linked playlist pair:

  1. Reads the current tracks on both Spotify and YouTube Music.
  2. Compares both sides against the snapshot stored after the previous successful sync.
  3. Propagates additions and removals cleanly:
    • First sync (no snapshot yet): merges both playlists and never removes anything.
    • Added on one side: added to the other side.
    • Removed on one side (and unchanged on the other): removed from the other side.
    • Conflict (removed on one side, re-added on the other): presence wins.
    • Track not found on the other service: never treated as a removal.

Matching engine ​

Tracks are matched in order of confidence:

  1. Exact ISRC → score 1.0.
  2. Scored fuzzy match: combines normalized title (50%), artist overlap (30%), and duration tolerance within 3s (20%).
  3. Normalization: Unicode NFKC (handles full-width CJK punctuation), diacritic stripping, and removal of edition suffixes like - Remastered 2007, - 2015 Remaster, - Re-Recorded, (feat. ...), and - Deluxe Edition.
  4. Version guard: rejects live, remix, cover, karaoke, instrumental, acoustic, sped up, or slowed candidates unless the source track also has that trait.

Built-in safety nets ​

  • --dry-run: previews every addition, removal, and unmatched track without modifying any playlist.
  • Automatic backups: before modifying a playlist, its full current track list is saved as JSON in profiles/<name>/backups/.
  • Empty-playlist guard: if a pass would remove 100% of a non-empty playlist, it is aborted unless --force is passed.
  • 20% threshold: if a pass would remove more than 20% of a playlist with 10+ tracks, it is aborted unless --force is passed.
  • Hard cap: at most 25 deletions per pair per pass without --force.