Skip to content

fetchart: handle sources config given as plain string#6437

Open
wavebyrd wants to merge 1 commit intobeetbox:masterfrom
wavebyrd:fix-fetchart-filesystem
Open

fetchart: handle sources config given as plain string#6437
wavebyrd wants to merge 1 commit intobeetbox:masterfrom
wavebyrd:fix-fetchart-filesystem

Conversation

@wavebyrd
Copy link

Summary

  • Fix fetchart failing with "no art found" when sources is configured as a plain string (e.g. sources: filesystem) instead of a list (sources: [filesystem]).
  • In confuse 2.2.0, the Pairs template no longer inherits StrSeq's string-to-list normalization, so a bare string gets iterated character by character. This normalizes the value to a list before passing it to as_pairs().
  • Adds tests for both string and list forms of the sources config.

Fixes #6336
Related: #5962

Test plan

  • Existing fetchart tests pass
  • New tests verify sources: filesystem (string), sources: [filesystem] (list), and sources: filesystem coverart (space-separated string) all produce the correct source objects

@wavebyrd wavebyrd requested a review from a team as a code owner March 13, 2026 02:57
if isinstance(raw_sources, str):
self.config["sources"].set(raw_sources.split())
sources = sanitize_pairs(
self.config["sources"].as_pairs(default_value="*"),
Copy link
Member

Choose a reason for hiding this comment

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

Is it not possible to simply

Suggested change
self.config["sources"].as_pairs(default_value="*"),
self.config["sources"].as_str_seq(),

?

@wavebyrd
Copy link
Author

Ping on this fetchart sources config fix. Ready for review!

@snejus
Copy link
Member

snejus commented Mar 16, 2026

I added a comment above. You need to fix your branch as you have many conflicts somehow.

When the 'sources' config is a plain string (e.g. "sources: filesystem"
rather than "sources: [filesystem]"), confuse 2.2.0's Pairs template
iterates over individual characters instead of treating it as a single
source name. This is because Pairs no longer inherits StrSeq's
string-to-list normalization.

Normalize the config value to a list before calling as_pairs() so both
forms work correctly.

Fixes beetbox#6336
@wavebyrd wavebyrd force-pushed the fix-fetchart-filesystem branch from 3763b9b to 0e138fe Compare March 17, 2026 17:04
@wavebyrd
Copy link
Author

Fixed! I've rebased the branch to cleanly apply on top of master - it now contains only the single commit for this fix. Sorry for the messy history!

@snejus
Copy link
Member

snejus commented Mar 17, 2026

See the failures in CI - there are multiple issues. Tests are failing and you will need to reformat the docs using poe format-docs.

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.

fetchart: "no art found" when filesystem is only source

2 participants