Skip to content

Commit

Permalink
Fix error queueing tracks without track data
Browse files Browse the repository at this point in the history
  • Loading branch information
justin025 committed Oct 27, 2024
1 parent a2bf38a commit 7230a5c
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/onthespot/api/spotify.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,18 +516,18 @@ def spotify_get_track_metadata(session, item_id):
10: "A♯/B♭",
11: "B"
}

info['bpm'] = str(track_audio_data.get('tempo', ''))
info['key'] = str(key_mapping.get(track_audio_data.get('key', ''), ''))
info['time_signature'] = track_audio_data.get('time_signature', '')
info['acousticness'] = track_audio_data.get('acousticness', '')
info['danceability'] = track_audio_data.get('danceability', '')
info['energy'] = track_audio_data.get('energy', '')
info['instrumentalness'] = track_audio_data.get('instrumentalness', '')
info['liveness'] = track_audio_data.get('liveness', '')
info['loudness'] = track_audio_data.get('loudness', '')
info['speechiness'] = track_audio_data.get('speechiness', '')
info['valence'] = track_audio_data.get('valence', '')
if track_audio_data is not None:
info['bpm'] = str(track_audio_data.get('tempo', ''))
info['key'] = str(key_mapping.get(track_audio_data.get('key', ''), ''))
info['time_signature'] = track_audio_data.get('time_signature', '')
info['acousticness'] = track_audio_data.get('acousticness', '')
info['danceability'] = track_audio_data.get('danceability', '')
info['energy'] = track_audio_data.get('energy', '')
info['instrumentalness'] = track_audio_data.get('instrumentalness', '')
info['liveness'] = track_audio_data.get('liveness', '')
info['loudness'] = track_audio_data.get('loudness', '')
info['speechiness'] = track_audio_data.get('speechiness', '')
info['valence'] = track_audio_data.get('valence', '')
return info


Expand Down

0 comments on commit 7230a5c

Please sign in to comment.