Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid duplicates on unmatched tracks #5228

Open
laker-93 opened this issue May 6, 2024 · 2 comments
Open

Avoid duplicates on unmatched tracks #5228

laker-93 opened this issue May 6, 2024 · 2 comments

Comments

@laker-93
Copy link

laker-93 commented May 6, 2024

If importing un matched music that has no musicbrainz link 'as is' then beets will not be able to identify duplicates.

For example, if I import a track that is not on music brainz I use the following flow

  1. import album 'as is'

If I follow this process again (e.g. import a second time and follow the above steps) then I end up with a duplicate track. Even the duplicates plugin does not detect this track as a duplicate.

Is there any way to configure beets to detect such duplicates? It should realise it has the same meta data for the track in the db surely? Same tags for artist, track, album etc.

For example, first import:

root@8f870a3c9e0e:/# beet import /downloads/

/downloads (1 items)
Finding tags for album "Laker - Noise From The Ruliad".
Candidates:
1. Laker - See The Stars Laker Mix 1 (64.3%) (album, tracks) (2023, XW)
2. Laker - If everything changed I know that you still feel the same (57.1%) (album, tracks) (Digital Media, 2023, XW)
3. Laker - Never Love Again (53.4%) (album, tracks, year) (Digital Media, 2022, XW)
4. Laker - Kyoto (51.9%) (album, tracks) (2023, XW)
5. Laker - Lets Go (Percs In The Bathroom) (51.4%) (album, tracks, year) (Digital Media, 2022, XW)
# selection (default 1), Skip, Use as-is, as Tracks, Group albums,
Enter search, enter Id, aBort? U

shows single track in collection:

root@8f870a3c9e0e:/# beet ls -p
/music/Laker/Noise From The Ruliad/01 - Escape.mp3

If I then import again:

root@8f870a3c9e0e:/# beet import /downloads/

/downloads (1 items)
Finding tags for album "Laker - Noise From The Ruliad".
Candidates:
1. Laker - See The Stars Laker Mix 1 (64.3%) (album, tracks) (2023, XW)
2. Laker - If everything changed I know that you still feel the same (57.1%) (album, tracks) (Digital Media, 2023, XW)
3. Laker - Never Love Again (53.4%) (album, tracks, year) (Digital Media, 2022, XW)
4. Laker - Kyoto (51.9%) (album, tracks) (2023, XW)
5. Laker - Lets Go (Percs In The Bathroom) (51.4%) (album, tracks, year) (Digital Media, 2022, XW)
# selection (default 1), Skip, Use as-is, as Tracks, Group albums,
Enter search, enter Id, aBort? U

/downloads
/music/Laker/Noise From The Ruliad/01 - Escape.mp3 (2 items)
Finding tags for album "Laker - Noise From The Ruliad".
Candidates:
1. Laker - See The Stars Laker Mix 1 (60.3%) (album, tracks, unmatched tracks) (2023, XW)
2. Laker - If everything changed I know that you still feel the same (53.5%) (album, tracks, unmatched tracks) (Digital Media, 2023, XW)
3. Laker - Louboutins Balmain Freestyle (51.1%) (album, tracks, unmatched tracks) (2023, XW)
4. Laker - Lets Go (Percs In The Bathroom) (48.2%) (album, tracks, unmatched tracks, ...) (Digital Media, 2022, XW)
5. Laker - JUST*F0R&FUN::) (46.7%) (album, tracks, unmatched tracks, ...) (2022, XW)
# selection (default 1), Skip, Use as-is, as Tracks, Group albums,
Enter search, enter Id, aBort? U

I then end up with a duplicate:

root@8f870a3c9e0e:/# beet ls -p
/music/Laker/Noise From The Ruliad/01 - Escape.1.mp3
/music/Laker/Noise From The Ruliad/01 - Escape.mp3

Clearly beets knows this is a duplicate somewhere as it has had to add the ‘.1’ extension to the track. Is there a config option to tell beets to merge the duplicate instead? I have the duplicate merge action set in my config. Perhaps this doesn’t work with tracks that aren’t matched against musicbrainz?

The issue is similar to this: https://discourse.beets.io/t/deleting-duplicate-songs-on-import/1224 however I'm looking for a solution that works for tracks that don't match against an entry in musicbrainz.

@jackwilsdon
Copy link
Member

The duplicates plugin allows you to configure which keys to use when detecting duplicates. By default it's mb_trackid and mb_albumid, which won't be set for tracks which were not tagged by MusicBrainz. You could try changing this to title and album which would only match duplicates with the same title and album:

duplicates:
  keys:
    - title
    - album

@laker-93
Copy link
Author

Thank for the information @jackwilsdon. Do you know if it' possible to specify multiple keys? E.g. use mb_trackid and mb_albumid but if not set use title and album?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants