Skip to content

Commit

Permalink
Fix memory leak in album parser
Browse files Browse the repository at this point in the history
  • Loading branch information
justin025 committed Oct 24, 2024
1 parent 0a536e8 commit c6b5e50
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/onthespot/api/spotify.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,15 @@ def spotify_get_lyrics(session, item_id, item_type, metadata, filepath):
lyrics.append(f'[ti:{title}]')

elif key == 'artists' and config.get("embed_artist"):
artist = conv_list_format(value)
artist = value
lyrics.append(f'[ar:{artist}]')

elif key in ['album_name', 'album'] and config.get("embed_album"):
album = value
lyrics.append(f'[al:{album}]')

elif key in ['writers'] and config.get("embed_writers"):
author = conv_list_format(value)
author = value
lyrics.append(f'[au:{author}]')

if item_type == "track":
Expand Down Expand Up @@ -297,10 +297,11 @@ def spotify_get_album_tracks(session, album_id):
headers=headers,
params=params
)

offset += limit
songs.extend(resp['items'])

if len(resp['items']) < limit:
if resp['total'] <= offset:
break
return songs

Expand Down

0 comments on commit c6b5e50

Please sign in to comment.