• Aryan Noshirvnai's avatar
    Skip re-tagging/re-storing a song a user already has in their library · a97f9454
    Aryan Noshirvnai authored
    Previously, re-uploading (or re-tagging from Telegram) a file already
    in your library created a brand new LibrarySong row and a second copy
    of the stored file every time - the IdentifiedTrack cache already
    skipped re-identifying it, but still re-ran ffmpeg tagging and wrote a
    duplicate file, and always inserted a new row. Add a fingerprint
    column to library_songs and check it (per-user) before doing any of
    that: a match now just hands back the existing entry.
    
    Dedup is per-user and keyed by the same content fingerprint already
    used for the IdentifiedTrack cache, not by title/artist text (which
    drifts across correction passes and isn't reliable for this).
    Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
    a97f9454
music.py 10.1 KB