good
This commit is contained in:
parent
91b5791ba7
commit
9a3f1e9c9f
6 changed files with 4850 additions and 313 deletions
Binary file not shown.
|
|
@ -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():
|
||||
|
|
|
|||
3388
logs/app.log
3388
logs/app.log
File diff suppressed because it is too large
Load diff
BIN
ui/pages/__pycache__/artists.cpython-310.pyc
Normal file
BIN
ui/pages/__pycache__/artists.cpython-310.pyc
Normal file
Binary file not shown.
Binary file not shown.
1750
ui/pages/artists.py
1750
ui/pages/artists.py
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue