Skip to content

bug(catalog): duplicate tracks created when re-importing same YouTube URL #42

Closed

Description

@thcp

Summary

Importing the same YouTube video more than once creates duplicate entries in the library, even though deduplication logic exists.

Root cause

normalizeSource() performed only a plain string trim. URLs like https://www.youtube.com/watch?v=xxx&t=10, https://youtu.be/xxx, and https://youtube.com/watch?v=xxx?si=yyy are the same video but produce different normalized strings, bypassing the duplicate check in findTrackBySource().

Fix

normalizeSource() now extracts the 11-character YouTube video ID from both youtu.be/<id> and ?v=<id> forms and returns yt:<id> as the canonical key. All URL variants for the same video now deduplicate correctly.

Release

0.5.0-alpha.1

Activity

  1. added this to the 0.5.0-alpha.1 milestone on May 17, 2026
  2. added
    bugSomething isn't working
    on May 17, 2026
  3. thcp commented on May 17, 2026

    @thcp
    CollaboratorAuthor

    Fixed: normalizeSource() now extracts the 11-char YouTube video ID from all URL variants (youtu.be, ?v=, etc.) so re-importing the same video is detected as a duplicate and the existing entry is updated rather than duplicated.

  4. self-assigned this
    on Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions