Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused variables and statements with no effect from the search artist function #183

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions lyricsgenius/genius.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,6 @@ def search_artist(self, artist_name, max_songs=None,
This method looks for the artist by the name or by the
ID if it's provided in ``artist_id``. It returrns an
:class:`Artist <types.Artist>` object if the search is successful.
If :obj:`allow_name_change` is True, the name of the artist is changed to the
artist name on Genius.

Args:
artist_name (:obj:`str`): Name of the artist to search for.
Expand All @@ -472,8 +470,7 @@ def search_artist(self, artist_name, max_songs=None,
per_page (:obj:`int`, optional): Number of results to return
per search page. It can't be more than 50.
get_full_info (:obj:`bool`, optional): Get full info for each song (slower).
allow_name_change (:obj:`bool`, optional): If True, search attempts to
switch to intended artist name.
allow_name_change (:obj:`bool`, optional): Doesn't do anything, exists to maintain backwards compatibility.
artist_id (:obj:`int`, optional): Allows user to pass an artist ID.
include_features (:obj:`bool`, optional): If True, includes tracks
featuring the artist.
Expand Down Expand Up @@ -503,7 +500,6 @@ def find_artist_id(search_term):
print('Searching for songs by {0}...\n'.format(search_term))

# Perform a Genius API search for the artist
found_artist = None
response = self.search_all(search_term)
found_artist = self._get_item_from_search_response(response,
search_term,
Expand All @@ -524,12 +520,6 @@ def find_artist_id(search_term):
return None

artist_info = self.artist(artist_id)['artist']
found_name = artist_info['name']
if found_name != artist_name and allow_name_change:
if self.verbose:
print("Changing artist name to '{a}'".format(
Steffo99 marked this conversation as resolved.
Show resolved Hide resolved
a=safe_unicode(found_name)))
artist_name = found_name

# Create the Artist object
artist = Artist(self, artist_info)
Expand Down