Skip to content

Add --primary-only flag to filter out featured appearances at song level #56

Description

@shimpeiws

Problem

GeniusClient.get_artist_songs() returns songs where the target artist may only be featured (primary artist is someone else). Song.artist_id is already captured but not used for filtering.

Proposed Changes

src/barscan/genius/models.py

  • Add songs_filtered: int = Field(0) to ArtistWithSongs

src/barscan/genius/client.py

  • Add primary_only: bool = False to get_artist_songs() and get_all_lyrics()
  • When enabled, filter songs where song.artist_id != artist.id
  • Log filtered count at debug level

src/barscan/cli.py

  • Add --primary-only option (default off)
  • Display filtered count in output

Tests

  • tests/test_genius/test_client.py: TestPrimaryOnlyFiltering - mixed artist_id filtering, passthrough when disabled, all-filtered edge case
  • tests/test_genius/test_models.py: songs_filtered field
  • tests/test_cli/test_commands.py: --primary-only flag

Dependencies

No dependencies.

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