Autotagger returns only the first candidate for an ID that is present in multiple sources
Problem
I am reimporting an album from Discogs that has an ID 853460. To underline the issue,
I use only Discogs and Deezer data sources and I set search_limit: 1 for both:
$ beet -vv import -LI now music 65 --disable-plugins=musicbrainz,spotify,bandcamp
user configuration: /home/sarunas/.config/beets/config.yaml
data directory: /home/sarunas/.config/beets
plugin paths: []
Loading plugins: autobpm, bareasc, bench, deezer, discogs, edit, embedart, fetchart, importreplace, info, inline, lastgenre, lastimport, lyrics, mbcollection, mbsync, missing, mpdstats, mpdupdate, random, replaygain, scrub, types, unimported
fetchart: google: Disabling art source due to missing key
inline: adding item field has_lyrics
inline: adding item field label_or_albumartist
inline: adding item field singleton_track_artist
inline: adding item field track_artist
inline: adding item field album_name
inline: adding item field track_identification
inline: adding item field withdrawn
inline: adding album field label_or_albumartist
inline: adding album field multiple_artists
lastgenre: Loading whitelist /home/sarunas/repo/beets/beetsplug/lastgenre/genres.txt
Sending event: pluginload
library database: /home/sarunas/.music/beets/library.db
library directory: /run/media/sarunas/music/Music
Sending event: library_opened
Sending event: import_begin
Parsed query: AndQuery([OrQuery([SubstringQuery('album', 'now', fast=True), SubstringQuery('albumartist', 'now', fast=True), SubstringQuery('genre', 'now', fast=True)]), OrQuery([SubstringQuery('album', 'music', fast=True), SubstringQuery('albumartist', 'music', fast=True), SubstringQuery('genre', 'music', fast=True)]), OrQuery([SubstringQuery('album', '65', fast=True), SubstringQuery('albumartist', '65', fast=True), SubstringQuery('genre', '65', fast=True)])])
Parsed sort: NullSort()
yielding album 12136: Various Artists - Now That's What I Call Music! 65
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_start
Looking up: /run/media/sarunas/music/Music/virgin/nowthatswhaticallmusic65/1_01_scissorsisters_idontfeellikedancin.flac; /run/media/sarunas/music/Music/virgin/nowthatswhaticallmusic65/1_02_shakirafeatwyclefjeanfeatwyclefjean_hipsdontlie.flac; /run/media/sarunas/music/Music/virgin/nowthatswhaticallmusic65/1_05_amywinehouse_rehab.flac; /run/media/sarunas/music/Music/virgin/nowthatswhaticallmusic65/1_09_justintimberlake_sexyback.flac; /run/media/sarunas/music/Music/virgin/nowthatswhaticallmusic65/1_10_nellyfurtadofeattimbalandfeattimbaland_promiscuous.flac; /run/media/sarunas/music/Music/virgin/nowthatswhaticallmusic65/1_11_beyonce_dejavu.flac; /run/media/sarunas/music/Music/virgin/nowthatswhaticallmusic65/1_12_chamillionairefeatkrayziebonefeatkrayziebone_ridin.flac; /run/media/sarunas/music/Music/virgin/nowthatswhaticallmusic65/1_14_feddelegrand_putyourhandsupfordetroit.flac; /run/media/sarunas/music/Music/virgin/nowthatswhaticallmusic65/1_15_fergie_londonbridge.flac; /run/media/sarunas/music/Music/virgin/nowthatswhaticallmusic65/1_16_thepussycatdolls_idontneedaman.flac; /run/media/sarunas/music/Music/virgin/nowthatswhaticallmusic65/1_18_cassie_meu.flac; /run/media/sarunas/music/Music/virgin/nowthatswhaticallmusic65/1_20_rihanna_unfaithful.flac
Tagging Various Artists - Now That's What I Call Music! 65
Searching for discovered album ID: 853460
Sending event: albuminfo_received
Candidate: JJ Symon & The Monochromes - Black, White & Grey (853460)
Computing track assignment...
...done.
Success. Distance: 0.84
Sending event: album_matched
Album ID match recommendation is 1
Search terms: Various Artists - Now That's What I Call Music! 65
Album might be VA: True
deezer: Searching Deezer for 'album:'Now That's What I Call Music! 65''
deezer: Found 1 result(s) from Deezer for 'album:'Now That's What I Call Music! 65''
Sending event: albuminfo_received
Candidate: Eric Dane Jaqua - Now That's What I Call EDJOMB! (796914581)
Computing track assignment...
...done.
Success. Distance: 0.73
Sending event: album_matched
Sending event: albuminfo_received
Candidate: Various Artists - Now That's What I Call Rock (25179484)
Computing track assignment...
...done.
Success. Distance: 0.71
Sending event: album_matched
Evaluating 3 candidates.
/run/media/sarunas/music/Music/virgin/nowthatswhaticallmusic65/1_01_scissorsisters_idontfeellikedancin.flac
/run/media/sarunas/music/Music/virgin/nowthatswhaticallmusic65/1_02_shakirafeatwyclefjeanfeatwyclefjean_hipsdontlie.flac
/run/media/sarunas/music/Music/virgin/nowthatswhaticallmusic65/1_05_amywinehouse_rehab.flac
/run/media/sarunas/music/Music/virgin/nowthatswhaticallmusic65/1_09_justintimberlake_sexyback.flac
/run/media/sarunas/music/Music/virgin/nowthatswhaticallmusic65/1_10_nellyfurtadofeattimbalandfeattimbaland_promiscuous.flac
/run/media/sarunas/music/Music/virgin/nowthatswhaticallmusic65/1_11_beyonce_dejavu.flac
/run/media/sarunas/music/Music/virgin/nowthatswhaticallmusic65/1_12_chamillionairefeatkrayziebonefeatkrayziebone_ridin.flac
/run/media/sarunas/music/Music/virgin/nowthatswhaticallmusic65/1_14_feddelegrand_putyourhandsupfordetroit.flac
/run/media/sarunas/music/Music/virgin/nowthatswhaticallmusic65/1_15_fergie_londonbridge.flac
/run/media/sarunas/music/Music/virgin/nowthatswhaticallmusic65/1_16_thepussycatdolls_idontneedaman.flac
/run/media/sarunas/music/Music/virgin/nowthatswhaticallmusic65/1_18_cassie_meu.flac
/run/media/sarunas/music/Music/virgin/nowthatswhaticallmusic65/1_20_rihanna_unfaithful.flac (12 items)
Sending event: import_task_before_choice
Sending event: before_choose_candidate
Finding tags for album "Various Artists - Now That's What I Call Music! 65".
Candidates:
1. (29.2%) Various Artists - Now That's What I Call Rock
≠ label, year, album, ...
Discogs, Various Artists, Now That's What I Call Rock, 3xVinyl, 2022, None, None, LPRKNOW1, Sony Music, LP, Compilation, Stereo, None, Europe, rock
2. (27.0%) Eric Dane Jaqua - Now That's What I Call EDJOMB!
≠ artist, label, year, ...
Deezer, Eric Dane Jaqua, Now That's What I Call EDJOMB!, None, 2025, 7, 2, None, Quo Vadis, album, None, None, None
3. (15.6%) JJ Symon & The Monochromes - Black, White & Grey
≠ artist, album, label, ...
Deezer, JJ Symon & The Monochromes, Black, White & Grey, None, 2009, 11, 21, None, E.O.I. Productions, album, None, None, None
The most relevant logs are here:
Searching for discovered album ID: 853460
Sending event: albuminfo_received
Candidate: JJ Symon & The Monochromes - Black, White & Grey (853460)
Computing track assignment...
...done.
Success. Distance: 0.84
Sending event: album_matched
Album ID match recommendation is 1
Search terms: Various Artists - Now That's What I Call Music! 65
...
Finding tags for album "Various Artists - Now That's What I Call Music! 65".
Candidates:
1. (29.2%) Various Artists - Now That's What I Call Rock
≠ label, year, album, ...
Discogs, Various Artists, Now That's What I Call Rock, 3xVinyl, 2022, None, None, LPRKNOW1, Sony Music, LP, Compilation, Stereo, None, Europe, rock
2. (27.0%) Eric Dane Jaqua - Now That's What I Call EDJOMB!
≠ artist, label, year, ...
Deezer, Eric Dane Jaqua, Now That's What I Call EDJOMB!, None, 2025, 7, 2, None, Quo Vadis, album, None, None, None
3. (15.6%) JJ Symon & The Monochromes - Black, White & Grey
≠ artist, album, label, ...
Deezer, JJ Symon & The Monochromes, Black, White & Grey, None, 2009, 11, 21, None, E.O.I. Productions, album, None, None, None
beets found a match on Deezer with the same ID 853460 and it did not attempt to try
any further data sources, even though the album I am looking for comes from Discogs.
This is especially an issue considering that the candidate from Deezer is not a good match to my original album.
Setup
- beets version: 2.5.1
From what I understand, reimport -L behaves the same as --search-id when the pre-existing ID is present in the DB. In your case, album_is 853460 was discovered and used.
I assume you want the autotagger to query all enabled sources (and use the IDs where applicable) to find the best match.
album_is 853460 was discovered and used.
Indeed, however, the issue is that it used this ID to only look as far as Deezer - while I expected it to return matching IDs from other data sources as well (before the search).
A fix to this problem is quite straight forward. Although we could argue this is not a bug but a feature and boils down to the question of how do we want to define ids in general.
Take for instance:
https://open.spotify.com/album/6esrjmMzbOdfL89SGB3tXx
If we consider the full url as identifier. There is no way for any other source to match this id so it is fine to early exit our lookup after we found one match. We can think about the ids to album/tracks as a bijection, there is only ever one valid match for a given id.
If we now consider only the hash part of the url as id, it is not as simple anymore:
6esrjmMzbOdfL89SGB3tXx
This can likely match to a number of different sources (given they use similar hashing methods). This is the surjective case i.e. we have a one-to-many.
Shouldn't it work even with the hash part? The identifiers across different tag sources are not similar. The probability that the 853460 album_id is used for the same album across a different source is close to 0. I think this is related to #6181
I mean this is the issue here tho:
https://www.discogs.com/release/853460-Various-Now-Thats-What-I-Call-Music-65 https://www.deezer.com/us/album/853460
Both use the same id 853460. Kinda unlucky both services use the same id schema 😆
Oh wow.....I would have never expected that. To be fair, the probability is close to 0, but that does not mean it cannot happen 😜
$ beet list data_source:Deezer -f '$data_source $mb_albumid $mb_trackid'
Deezer
deezer 370280807 1985876917
deezer 382439727 2045351817
deezer 1206154 13144759
deezer 356922 3829297
Deezer 76719 603418
Deezer 182066982 1121052792
Deezer 233946292 1388615962
$ beet list data_source:discogs -f '$data_source $mb_albumid $mb_trackid'
Discogs
Discogs 0380e22e-1e66-4a8c-a11a-1c94227dd5fc 5783796-1
Discogs 1004312 1004312-5
Discogs 10121300 10121300-A1
Discogs 1022092 1022092-1
Discogs 10245447 10245447-A2
Discogs 1041851 1041851-A
Discogs 10488790 10488790-1
Discogs 10488790 10488790-3
Discogs 10533406 10533406-B2
Discogs 10597375 10597375-1-7
Discogs 10636229 10636229-3
Discogs 1074515 1074515-1
Discogs 10821542 10821542-4
Discogs 10920273 10920273-1-3
Discogs 10920273 10920273-4-1
Discogs 1099424 1099424-1-1
Discogs 1099424 1099424-1-2
Discogs 1099424 1099424-1-4