Skip to content

Commit

Permalink
Fixed bug with local files
Browse files Browse the repository at this point in the history
  • Loading branch information
holy-jesus committed Aug 24, 2024
1 parent 483b753 commit 7678bb4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion aw_watcher_spotify/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ def get_current_track(sp) -> Optional[dict]:

def data_from_track(track: dict, sp) -> dict:
song_name = track["item"]["name"]
data = sp.audio_features(track["item"]["id"])[0] or {}
data = (
(sp.audio_features(track["item"]["id"])[0] or {}) if track["item"]["id"] else {}
)
data["title"] = song_name
data["uri"] = track["item"]["uri"]

Expand Down

0 comments on commit 7678bb4

Please sign in to comment.