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.
Problem
GeniusClient.get_artist_songs()returns songs where the target artist may only be featured (primary artist is someone else).Song.artist_idis already captured but not used for filtering.Proposed Changes
src/barscan/genius/models.pysongs_filtered: int = Field(0)toArtistWithSongssrc/barscan/genius/client.pyprimary_only: bool = Falsetoget_artist_songs()andget_all_lyrics()song.artist_id != artist.idsrc/barscan/cli.py--primary-onlyoption (default off)Tests
tests/test_genius/test_client.py:TestPrimaryOnlyFiltering- mixed artist_id filtering, passthrough when disabled, all-filtered edge casetests/test_genius/test_models.py:songs_filteredfieldtests/test_cli/test_commands.py:--primary-onlyflagDependencies
No dependencies.