Skip to content

Utilize title_with_featured for featured artist extraction and output enrichment #58

Description

@shimpeiws

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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions