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(),

?

Copy link
Member

Choose a reason for hiding this comment

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

My comment has not been addressed @wavebyrd.

@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.

@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.

When 'sources' is given as a plain string (e.g. 'sources: filesystem'
instead of 'sources: [filesystem]'), confuse's Pairs template iterates
over individual characters instead of treating it as a single-item list.
This normalizes the string to a list before calling as_pairs().

Fixes beetbox#6336

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@wavebyrd wavebyrd force-pushed the fix-fetchart-filesystem branch from 0e138fe to f33592e Compare March 19, 2026 01:22
@wavebyrd
Copy link
Author

Fixed! Rebased cleanly on master with just the single commit for this fix. Added tests and changelog entry. Let me know if the docs formatting needs adjustment - I couldn't get the local docstrfmt to work with the --preserve-adornments flag.

@snejus
Copy link
Member

snejus commented Mar 19, 2026

Still failing

@snejus
Copy link
Member

snejus commented Mar 19, 2026

Is there a human behind @wavebyrd or is it a bot?

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