Problem
Song.title_with_featured (e.g., "Song (ft. Drake & Future)") contains featured artist names but is never parsed or used. This info could improve section header matching accuracy in --filter-featured and enrich output.
Proposed Changes
New file: src/barscan/genius/featuring.py
FEATURED_PATTERN regex matching ft., feat., featuring, with
parse_featured_artists(title_with_featured) -> list[str]
split_artist_names(names_str) -> list[str] - splits on &, ,, and
src/barscan/cli.py
- When
--filter-featured is active, parse featured artists from song.title_with_featured
- Pass to
analyze_text() for section matching
src/barscan/output/wordgrain.py
- Add
featured_artists: tuple[str, ...] | None = Field(default=None) to WordGrainMeta
- Populate when available
Tests
- New
tests/test_genius/test_featuring.py: various title formats, multiple artists, Japanese
tests/test_output/test_wordgrain.py: featured_artists in meta
tests/test_cli/test_commands.py: integration test
Dependencies
Depends on #57 (--filter-featured flag and featured_artists param from analyze_text()).
Problem
Song.title_with_featured(e.g.,"Song (ft. Drake & Future)") contains featured artist names but is never parsed or used. This info could improve section header matching accuracy in--filter-featuredand enrich output.Proposed Changes
New file:
src/barscan/genius/featuring.pyFEATURED_PATTERNregex matchingft.,feat.,featuring,withparse_featured_artists(title_with_featured) -> list[str]split_artist_names(names_str) -> list[str]- splits on&,,,andsrc/barscan/cli.py--filter-featuredis active, parse featured artists fromsong.title_with_featuredanalyze_text()for section matchingsrc/barscan/output/wordgrain.pyfeatured_artists: tuple[str, ...] | None = Field(default=None)toWordGrainMetaTests
tests/test_genius/test_featuring.py: various title formats, multiple artists, Japanesetests/test_output/test_wordgrain.py:featured_artistsin metatests/test_cli/test_commands.py: integration testDependencies
Depends on #57 (
--filter-featuredflag andfeatured_artistsparam fromanalyze_text()).