Skip to content

Discogs: fixes for: 6177, 6068#6179

Merged
henry-oberholtzer merged 14 commits intomasterfrom
discogs-fixes
Jan 19, 2026
Merged

Discogs: fixes for: 6177, 6068#6179
henry-oberholtzer merged 14 commits intomasterfrom
discogs-fixes

Conversation

@henry-oberholtzer
Copy link
Copy Markdown
Member

@henry-oberholtzer henry-oberholtzer commented Nov 23, 2025

Description

Fixes #6177, #6068.

I fixed the issue in #6177 by removing the derived class interface, and moving those fields back into function variables. They're a bit unwieldy still, but that's the algorithm it came with. There's a lot of room to continue to improve the clarity of the code in that section, but I think that'll require a deeper overhaul.

For #6068, I created the ArtistInfo and AlbumArtistInfo typed dictionaries, and was able to centralize the logic of building the artist info into build_artistinfo and build_albumartistinfo. Tests for these scenarios were created largely by expanding existing tests to incorporate the new fields.

I think I'll have to re-think the entire algorithm for 6030 to make it more flexible at parsing the issue for #6030, so I'll move that to a later PR in the interest of getting the flex attr fix in.

To Do

  • Changelog. (Add an entry to docs/changelog.rst to the bottom of one of the lists near the top of the document.)
  • Tests.

@henry-oberholtzer henry-oberholtzer added the discogs discogs plugin label Nov 23, 2025
@henry-oberholtzer henry-oberholtzer force-pushed the discogs-fixes branch 2 times, most recently from 91ece4c to d68514e Compare December 9, 2025 07:34
@henry-oberholtzer henry-oberholtzer changed the title Discogs: fixes for: 6177, 6068, 6030 Discogs: fixes for: 6177, 6068 Dec 9, 2025
@henry-oberholtzer henry-oberholtzer marked this pull request as ready for review December 9, 2025 07:35
@henry-oberholtzer henry-oberholtzer requested a review from a team as a code owner December 9, 2025 07:35
sourcery-ai[bot]

This comment was marked as outdated.

@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 9, 2025

Codecov Report

❌ Patch coverage is 94.53552% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.76%. Comparing base (dbe97c2) to head (9b1bd5d).
⚠️ Report is 14 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
beetsplug/discogs/__init__.py 80.85% 7 Missing and 2 partials ⚠️
beetsplug/discogs/states.py 98.97% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6179      +/-   ##
==========================================
+ Coverage   68.73%   68.76%   +0.03%     
==========================================
  Files         138      140       +2     
  Lines       18555    18610      +55     
  Branches     3058     3051       -7     
==========================================
+ Hits        12753    12797      +44     
- Misses       5152     5165      +13     
+ Partials      650      648       -2     
Files with missing lines Coverage Δ
beetsplug/discogs/types.py 100.00% <100.00%> (ø)
beetsplug/discogs/states.py 98.97% <98.97%> (ø)
beetsplug/discogs/__init__.py 64.87% <80.85%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@henry-oberholtzer

This comment was marked as resolved.

@henry-oberholtzer henry-oberholtzer marked this pull request as draft December 9, 2025 17:37
@henry-oberholtzer henry-oberholtzer marked this pull request as ready for review December 10, 2025 05:21
sourcery-ai[bot]

This comment was marked as outdated.

Copy link
Copy Markdown
Contributor

@semohr semohr left a comment

Choose a reason for hiding this comment

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

I just had some time to have a look here. Added some comments for potential improvements.

Thanks for starting to tackle the discogs plugin, it is in dire need of some love 😄

Comment thread beetsplug/discogs.py Outdated
Comment thread beetsplug/discogs.py Outdated
Comment thread beetsplug/discogs.py Outdated
Comment thread beetsplug/discogs.py Outdated
Comment thread beetsplug/discogs.py Outdated
@henry-oberholtzer
Copy link
Copy Markdown
Member Author

Thanks Sebastian! I'm out of town at the moment but will get these applied once I'm back.

@semohr
Copy link
Copy Markdown
Contributor

semohr commented Dec 23, 2025

No hurry! Take your time and enjoy the holidays.

@semohr semohr self-assigned this Dec 23, 2025
@henry-oberholtzer henry-oberholtzer added this to the 2.6.0 milestone Dec 30, 2025
@henry-oberholtzer henry-oberholtzer linked an issue Dec 31, 2025 that may be closed by this pull request
Comment thread beetsplug/discogs.py Outdated
Copy link
Copy Markdown
Contributor

@semohr semohr left a comment

Choose a reason for hiding this comment

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

I think we should good here!

While the whole logic is still a bit convoluted, I feel like it is a major improvement from before the PR 👍

Thank you for taking the initiative!

@snejus snejus self-assigned this Jan 6, 2026
@henry-oberholtzer
Copy link
Copy Markdown
Member Author

Updated the variable name - can go ahead and merge if all looks good!

@semohr
Copy link
Copy Markdown
Contributor

semohr commented Jan 7, 2026

I think @snejus wants to have a look too since he self assigned this to himself too.

Copy link
Copy Markdown
Member

@snejus snejus left a comment

Choose a reason for hiding this comment

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

Sorry that it took me a long time to finally get to this! Well done, this is a big and important piece of work.

It seems to me that DiscogsPlugin now has a bit too many responsibilities. I think it would be a good idea to move the logic from _build_* methods to intermediate dataclasses which should make it easier for us to reason about it all and hopefully simplify the logic. I refactored a couple of bits as I reviewed this, so I'm opening a PR based from your last commit for you to review!

Comment thread beetsplug/discogs.py Outdated
Comment thread beetsplug/discogs.py Outdated
Comment thread beetsplug/discogs.py Outdated
Comment thread beetsplug/discogs.py Outdated
Comment thread test/plugins/test_discogs.py Outdated
Comment thread beetsplug/discogs.py Outdated
Comment thread beetsplug/discogs.py Outdated
Comment thread beetsplug/discogs.py Outdated
@snejus
Copy link
Copy Markdown
Member

snejus commented Jan 9, 2026

See #6277

@JOJ0 JOJ0 added the plugin Pull requests that are plugins related label Jan 10, 2026
@henry-oberholtzer
Copy link
Copy Markdown
Member Author

Split the plugin into four files since it's been feeling a bit unwieldy to sort through. Happy to undo or change the reorganization, but I think it's a bit easier to understand and navigate now.

Copy link
Copy Markdown
Member

@snejus snejus left a comment

Choose a reason for hiding this comment

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

Mostly looks good - we will want to move the subtracks merging functionality under TracklistState but this can be done in a separate PR :)

Comment thread beetsplug/discogs/utils.py Outdated
Comment thread beetsplug/discogs/states.py Outdated
Copy link
Copy Markdown
Member

@snejus snejus left a comment

Choose a reason for hiding this comment

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

Just need to rebase now :)

@henry-oberholtzer henry-oberholtzer merged commit 9b1bd5d into master Jan 19, 2026
20 checks passed
@henry-oberholtzer henry-oberholtzer deleted the discogs-fixes branch January 19, 2026 20:53
@henry-oberholtzer
Copy link
Copy Markdown
Member Author

Glad to finally have this fix in, now I can start thinking about all the other little improvements that are still left to make on the plugin...

@JOJ0 JOJ0 removed the plugin Pull requests that are plugins related label Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

discogs discogs plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unexpected flex attr saved by Discogs plugin: medium_str discogs: add support for multi value fields

4 participants