Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion beets/autotag/match.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def current_metadata(items):
consensus = {}
fields = ['artist', 'album', 'albumartist', 'year', 'disctotal',
'mb_albumid', 'label', 'catalognum', 'country', 'media',
'albumdisambig']
'albumdisambig', 'discogs_catalog']
for field in fields:
values = [item[field] for item in items if item]
likelies[field], freq = plurality(values)
Expand Down Expand Up @@ -233,6 +233,11 @@ def distance(items, album_info, mapping):
dist.add_string('catalognum', likelies['catalognum'],
album_info.catalognum)

# Discogs Catalog number.
if likelies['discogs_catalog'] and album_info.catalognum:
dist.add_string('catalognum', likelies['discogs_catalog'],
album_info.catalognum)

Comment on lines +236 to +240

@JOJ0 JOJ0 Mar 16, 2022

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not yet sure if what I'm and doing here is correct at all and would need advice from @wisp3rwind or @sampsyo. Do I overwrite something here? We use album_info.catalognum in the block before when handling the regular catalognum field.

I am also not yet sure what should happen when both discogs_catalog and catalognum tags exist on a file to be imported. Which one should be used for the mb-search-field catno then? Maybe it should be configurable which one should be taken if both exist?

# Disambiguation.
if likelies['albumdisambig'] and album_info.albumdisambig:
dist.add_string('albumdisambig', likelies['albumdisambig'],
Expand Down
1 change: 1 addition & 0 deletions beets/autotag/mb.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

FIELDS_TO_MB_KEYS = {
'catalognum': 'catno',
'discogs_catalog': 'catno',
'country': 'country',
'label': 'label',
'media': 'format',
Expand Down
1 change: 1 addition & 0 deletions beets/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ class Item(LibModel):
'discogs_albumid': types.INTEGER,
'discogs_artistid': types.INTEGER,
'discogs_labelid': types.INTEGER,
'discogs_catalog': types.STRING,
'lyricist': types.STRING,
'composer': types.STRING,
'composer_sort': types.STRING,
Expand Down