Skip to content

Add support for extra_tags in discogs plugin#6416

Closed
jdoe29103 wants to merge 63 commits intobeetbox:masterfrom
jdoe29103:master
Closed

Add support for extra_tags in discogs plugin#6416
jdoe29103 wants to merge 63 commits intobeetbox:masterfrom
jdoe29103:master

Conversation

@jdoe29103
Copy link
Contributor

Description

Fixes #6412.

Discogs plugin now supports the extra_tags configuration option.

To Do

  • Documentation.
  • Changelog.
  • Tests.

jdoe29103 and others added 2 commits March 5, 2026 17:53
@jdoe29103 jdoe29103 requested a review from a team as a code owner March 5, 2026 23:18
@codecov
Copy link

codecov bot commented Mar 6, 2026

Codecov Report

❌ Patch coverage is 84.74576% with 36 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.44%. Comparing base (edbf737) to head (1323347).
⚠️ Report is 52 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
beetsplug/discogs/__init__.py 61.11% 12 Missing and 2 partials ⚠️
beetsplug/spotify.py 50.00% 10 Missing and 1 partial ⚠️
beetsplug/deezer.py 30.00% 7 Missing ⚠️
beets/library/migrations.py 94.44% 0 Missing and 2 partials ⚠️
beets/util/lyrics.py 97.43% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6416      +/-   ##
==========================================
+ Coverage   69.39%   69.44%   +0.04%     
==========================================
  Files         141      141              
  Lines       18816    18485     -331     
  Branches     3068     3025      -43     
==========================================
- Hits        13057    12836     -221     
+ Misses       5112     5010     -102     
+ Partials      647      639       -8     
Files with missing lines Coverage Δ
beets/__init__.py 66.66% <100.00%> (ø)
beets/dbcore/db.py 94.48% <100.00%> (+0.06%) ⬆️
beets/library/library.py 93.65% <100.00%> (ø)
beets/metadata_plugins.py 86.52% <100.00%> (+10.40%) ⬆️
beetsplug/_utils/musicbrainz.py 92.85% <ø> (ø)
beetsplug/beatport.py 43.45% <100.00%> (+0.48%) ⬆️
beetsplug/bpsync.py 20.00% <100.00%> (+1.92%) ⬆️
beetsplug/fish.py 20.53% <100.00%> (ø)
beets/library/migrations.py 95.06% <94.44%> (-1.31%) ⬇️
beets/util/lyrics.py 97.43% <97.43%> (ø)
... and 3 more

... and 2 files 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.

jdoe29103 and others added 13 commits March 7, 2026 13:45
## Documentation Link Maintenance

This PR audits and fixes all hyperlinks across the beets documentation.
No functional code changes — purely doc hygiene.

### What changed

- **HTTP → HTTPS**: Upgrades all `http://` links to `https://` where
supported.
- **Broken/outdated URLs**: Replaces dead or redirected links with their
current canonical targets. Key examples:
  - `codecov.io` → `app.codecov.io`
- Python docs from `docs.python.org/library/` →
`docs.python.org/3/library/`
  - PEP links from `python.org/dev/peps/` → `peps.python.org/`
  - SourceForge project links updated to current project page URLs
- Spotify, Plex, Sonos, Discogs, IPFS, and other service URLs updated to
their current domains/paths
- Archived URLs wrapped in `web.archive.org` where the original is gone
(e.g. `echonest`, `albumart.org`, `phash`)
- **`docs/conf.py`**: Adds link-check exclusions for domains known to
block automated requests (SourceForge, fanart.tv, Imgur, Discogs
settings).

### Impact

No user-facing behaviour changes. Fixes broken links that would
frustrate contributors and users reading the docs, and unblocks the
Sphinx `linkcheck` builder from false positives.
Add a `requires_import` pytest marker and `is_importable` fixture to
conditionally skip or adjust assertions based on whether optional
dependencies are available. Apply this to `langdetect`-dependent
language detection tests in lyrics and migration test suites.
Replace static marker declarations in setup.cfg with dynamic
registration via pytest_configure hook in conftest.py.
Add force_ci kwarg to requires_import pytest marker to allow tests
to run unconditionally in CI (GitHub Actions), even if the module
is not detected locally. Refactor autobpm test to use this instead
of manual env-checking at module level.
## Skip `langdetect`-dependent tests when package is unavailable

Fixes #6421.

### What changed

- Adds a `requires_import(module)` pytest marker to `conftest.py` that
skips tests when an optional dependency is not installed
- Adds an `is_importable` fixture for conditional assertions within a
test body
- Marks `TestTranslation` and other `langdetect`-dependent
tests/assertions with the new marker or fixture
- Extends `requires_import` with a `force_ci=True` kwarg — tests marked
this way are **never** skipped in `beetbox/beets` CI, ensuring coverage
where all deps are installed
- Moves marker declarations from `setup.cfg` into `pytest_configure` in
`conftest.py`
snejus and others added 27 commits March 8, 2026 09:00
Move search orchestration into SearchApiMetadataSourcePlugin.

Migrate Deezer, Spotify, and Discogs to provider hooks.

Keep query handling, logging, and limits centralized.
Move MusicBrainzPlugin to SearchApiMetadataSourcePlugin hooks.

Keep entity mapping and criteria in provider-specific hooks.

Update typing and tests for the candidate search path.
Replace recursive 401 handling with a single retry loop.

This prevents unbounded recursion when authentication keeps failing.
Add developer guidance for SearchApiMetadataSourcePlugin and its hooks.

Clarify migration advice for API-backed metadata source plugins.
Add a unified search abstraction across metadata source plugins.

Summary:
- Introduces `SearchApiMetadataSourcePlugin` with `SearchParams`,
`get_search_query_with_filters`, and `get_search_response` hooks to
standardize album/track searches.
- Replaces ad-hoc `_search_api` and query construction logic in Deezer,
Spotify, MusicBrainz, and Discogs plugins with the new shared
implementation.
- Refactors Discogs and MusicBrainz plugins to use the new abstraction
and move provider-specific criteria/query construction into hook
methods.
- Centralizes error handling and logging in the shared search flow;
Spotify now retries authentication once on `401`, and failures cleanly
fall back to empty results at the shared layer.
Beatport has retired the API these plugins rely on, making them
non-functional. Add deprecation warnings and update documentation
to reflect the current state.

Fixes #3862
As agreed in the comments:
#4477 (comment)

Deprecation notices reference those for additional context:
- #3862
- #4477

Beatport retired the API (v3) that the built-in `beatport` plugin relies
on, making it non-functional. This PR soft-deprecates both the
`beatport` and `bpsync` plugins following the same pattern used for
`acousticbrainz` — adding deprecation warnings in `__init__()` while
keeping all existing code intact.

The `bpsync` plugin is deprecated alongside `beatport` since it imports
and depends on `BeatportPlugin` directly.

### Changes

- **`beetsplug/beatport.py`**: Add deprecation warning in
`BeatportPlugin.__init__()`
- **`beetsplug/bpsync.py`**: Add deprecation warning in
`BPSyncPlugin.__init__()`
- **`docs/plugins/beatport.rst`**: Add `.. deprecated::` directive
- **`docs/plugins/bpsync.rst`**: Add `.. deprecated::` directive
- **`docs/changelog.rst`**: Add changelog entry under Unreleased → Other
changes

### What's NOT changed (and why)

- **`pyproject.toml`** (beatport extra): Kept so the plugin loads and
shows the deprecation warning instead of crashing with an `ImportError`
- **`test/plugins/test_beatport.py`**: Tests cover data models which
still exist — all 15 tests pass
- **`docs/plugins/index.rst`**: `beatport` stays in the toctree since
the page still exists
- **`beets/util/id_extractors.py`**: Core utility, not plugin-specific
discogs extra_tags functionality
@jdoe29103 jdoe29103 requested review from semohr and snejus as code owners March 9, 2026 20:21
@jdoe29103 jdoe29103 closed this Mar 9, 2026
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.

6 participants