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

discogs: Skip Discogs query on insufficiently tagged files #4227

Merged
merged 4 commits into from
Jan 11, 2022

Conversation

JOJ0
Copy link
Member

@JOJ0 JOJ0 commented Jan 9, 2022

Description

Fixes #4222.

  • When files are missing both, album and artist tags, the Discogs metadata
    plugin sends empty information to the Discogs API which returns arbitrary
    query results. The resulting "Candidates" are not affiliated with the release being searched for at all and thus are more confusing than helpful to the beets user.
  • This patch catches this case and states it in beets import verbose output.
  • An example output of such arbitrary results with untagged files can be found here: Discogs plugin going south #4222 (comment)

To Do

  • Documentation. (If you've add a new command-line flag, for example, find the appropriate page under docs/ to describe it.) -> Should I add a short note to the Discogs plugin chapter?
  • Changelog. (Add an entry to docs/changelog.rst near the top of the document.) -> Will do that after this PR is approved. Currently I think the "Bug fixes:" section would be the right one to add to.
  • Tests. (Encouraged but not strictly required.) -> I can add a test if you think it is useful but haven't looked into the testsuite yet.

Notes

  • There might be a similar issue in other metadata source plugins as well (amazon, beetport, ...) but I haven't looked into them since I don't use them (yet).
  • There might be a better place to fix this than in the in the candidates method, please point me there / let's discuss. Thanks in advance!

@JOJ0
Copy link
Member Author

JOJ0 commented Jan 9, 2022

This is the beginning of an verbose output with the patch in place, using the same untagged album as used in the issue link above:

$ beet -v import --set genre_orig_dir="test import" /remote/data/music-archive/DowntempoTriphopDubAcidjazz/0-ALBUMS/Thievery\ Corporation\ -\ The\ Mirror\ Conspiracy\ C+D
user configuration: /home/jojo/.config/beets/config.yaml
data directory: /home/jojo/.config/beets
plugin paths: /home/jojo/git/beets/beetsplug; /home/jojo/git/mried_beetsplug/beetsplug; /home/jojo/.local/lib/python3.9/site-packages/beetsplug
artresizer: method is (2, (7, 1, 0), False)
thumbnails: using IM to write metadata
thumbnails: using GIO to compute URIs
Sending event: pluginload
library database: /home/jojo/jtbeets.db
library directory: /home/jojo/Music
Sending event: library_opened
Sending event: import_begin
Sending event: import_task_created
Sending event: import_task_start
Looking up: /remote/data/music-archive/DowntempoTriphopDubAcidjazz/0-ALBUMS/Thievery Corporation - The Mirror Conspiracy C+D
Tagging  - 
No album ID found.
Search terms:  - 
Album might be VA: True
discogs: Skipping Discogs query. Files missing album and artist tags.
Requesting MusicBrainz release 01fdaeb5-f4fc-46d6-a43c-4b2f61e95564
Sending event: mb_track_extract
Sending event: mb_track_extract
...
...

@sampsyo
Copy link
Member

sampsyo commented Jan 9, 2022

Seems like a great idea! Would you mind adding a quick changelog entry, please?

JOJ0 added a commit to JOJ0/beets that referenced this pull request Jan 10, 2022
Discogs query on insufficiently tagged files).
JOJ0 and others added 2 commits January 10, 2022 08:27
- When files are missing both, album and artist tags, the Discogs metadata
  plugin sends empty information to the Discogs API which returns arbitrary
  query results.
- This patch catches this case and states it in beets import verbose output.
Discogs query on insufficiently tagged files).
@JOJ0
Copy link
Member Author

JOJ0 commented Jan 10, 2022

Added changelog entry and rebased master into feature branch.

- Clarify basic search behaviour in intro chapter of discogs plugin,
- and state change introduced in PR#4227 (discogs: Discogs query on
  insufficiently tagged files)
@JOJ0
Copy link
Member Author

JOJ0 commented Jan 10, 2022

Also added a short note on general search behaviour and the newly introduced "skipping behaviour" to the plugin docs. I can leave it out if you think it's unnecessary clutter or doesn't fit into this PR.

Since some basic concepts are described in the "Installation" chapter already, I added it there.

Copy link
Member

@sampsyo sampsyo left a comment

Choose a reason for hiding this comment

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

Great; thanks!!! Seems nice to have for completeness' sake. I think this is good to go once the CI comes back green.

@sampsyo sampsyo merged commit 28ceda1 into beetbox:master Jan 11, 2022
@martimpassos
Copy link

Hello, is this supposed to have fixed this scenario? I would think that

Finding tags for album "A.R.T. - Everybody Need Somebody"

means my files have decent album and artist tags, but the results seem arbitrary as you mentioned. Am I missing something here?

@JOJ0
Copy link
Member Author

JOJ0 commented Mar 21, 2022

Hi @martimpassos, i answered to your forum post with some suggestions that might help to find out if this PR's fix could help.

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

Successfully merging this pull request may close these issues.

3 participants