This commit is contained in:
Broque Thomas 2025-07-25 17:52:00 -07:00
parent 91b5791ba7
commit 9a3f1e9c9f
6 changed files with 4850 additions and 313 deletions

View file

@ -430,6 +430,31 @@ class SpotifyClient:
except Exception as e:
logger.error(f"Error fetching album tracks: {e}")
return None
@rate_limited
def get_artist_albums(self, artist_id: str, album_type: str = 'album,single', limit: int = 50) -> List[Album]:
"""Get albums by artist ID"""
if not self.is_authenticated():
return []
try:
albums = []
results = self.sp.artist_albums(artist_id, album_type=album_type, limit=limit)
while results:
for album_data in results['items']:
album = Album.from_spotify_album(album_data)
albums.append(album)
# Get next batch if available
results = self.sp.next(results) if results['next'] else None
logger.info(f"Retrieved {len(albums)} albums for artist {artist_id}")
return albums
except Exception as e:
logger.error(f"Error fetching artist albums: {e}")
return []
def get_user_info(self) -> Optional[Dict[str, Any]]:
if not self.is_authenticated():

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff