Skip to content

Add Embedded Art support to fetchart plugin#6829

Open
overhacked wants to merge 4 commits into
beetbox:masterfrom
overhacked:overhacked/fetchart_embedded
Open

Add Embedded Art support to fetchart plugin#6829
overhacked wants to merge 4 commits into
beetbox:masterfrom
overhacked:overhacked/fetchart_embedded

Conversation

@overhacked

@overhacked overhacked commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Description

Add embedded source to extract embedded art from files. Add skip_embedded option to detect embedded art and skip fetching from other sources (if extracting isn't the desired end state).

If skip_embedded=yes, then files with embedded art are considered "done" and skipped by FetchArt. If the embedded source is enabled, then embedded artwork is always extracted. The two settings are independent of each other.

Fixes #1130.

To Do

  • Documentation.
  • Changelog.
  • Tests.

@overhacked
overhacked requested a review from a team as a code owner July 12, 2026 20:32
@github-actions github-actions Bot added the fetchart fetchart plugin label Jul 12, 2026
@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 54.54545% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.89%. Comparing base (4775599) to head (aac06ee).
⚠️ Report is 70 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
beetsplug/fetchart.py 54.76% 14 Missing and 5 partials ⚠️
beetsplug/_utils/art.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6829      +/-   ##
==========================================
- Coverage   74.92%   74.89%   -0.04%     
==========================================
  Files         163      163              
  Lines       21174    21211      +37     
  Branches     3341     3347       +6     
==========================================
+ Hits        15864    15885      +21     
- Misses       4544     4557      +13     
- Partials      766      769       +3     
Files with missing lines Coverage Δ
beetsplug/_utils/art.py 58.51% <50.00%> (ø)
beetsplug/fetchart.py 73.31% <54.76%> (-0.84%) ⬇️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@overhacked
overhacked marked this pull request as draft July 13, 2026 00:14
@overhacked

Copy link
Copy Markdown
Contributor Author

Taking this to draft to do a little work to improve the test coverage.

@overhacked
overhacked force-pushed the overhacked/fetchart_embedded branch from 02b1a4f to 18cd2e7 Compare July 14, 2026 18:00
Add `embedded` source to extract embedded art from files. Add
`skip_embedded` option to detect embedded art and skip fetching from
other sources (if extracting isn't the desired end state).

If `skip_embedded=yes`, then files with embedded art are considered "done" and
skipped by FetchArt. If the `embedded` source is enabled, then embedded
artwork is always extracted. The two settings are independent of each
other.

Fix variable shadowing lint due to added import of `_utils.art`.

Signed-off-by: Ross Williams <ross@ross-williams.net>
Add unit tests for Embedded source of FetchArt plugin.
Add integration tests for FetchArt plugin's handling of files with
embedded artwork.

Signed-off-by: Ross Williams <ross@ross-williams.net>
Signed-off-by: Ross Williams <ross@ross-williams.net>
Two messages were emitted in the lowest-level helper functions, which
meant that callers who expected a silent pass/fail result to validate
whether art is contained in media files would spam the CLI with
info-level messages. This commit moves the emission-site of the log
messages one level up the call stack so that the messages are only
emitted by a function that is called when the user requests that art is
extracted and needs success/skip/failure logged to the CLI.

Also add art extraction logging to fetchart.

Signed-off-by: Ross Williams <ross@ross-williams.net>
@overhacked
overhacked force-pushed the overhacked/fetchart_embedded branch from 18cd2e7 to aac06ee Compare July 15, 2026 13:25
@overhacked
overhacked marked this pull request as ready for review July 15, 2026 13:25
@overhacked

Copy link
Copy Markdown
Contributor Author

@snejus, this is ready whenever you have time to take a look. There are some test coverage places I'd like to address, but when investigating I found that more test harness refactoring around when plugins read their configuration (e.g. @cached_property and PluginMixin.preload_plugin vs .configure_plugin()) would be necessary to get more coverage; also, the coverage gaps--while technically part of this PR's diff--already existed in the fetchart CLI test suite, so I'd be adding tests that don't test the Embedded source directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fetchart fetchart plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fetchart: Extract embedded art

1 participant