From 4dc22faeeea36de6bb43d28243f205b9ce21fd65 Mon Sep 17 00:00:00 2001 From: Marijn Doeve Date: Sat, 10 Dec 2022 21:58:23 +0100 Subject: [PATCH] Update --- nporadio2/__main__.py | 2 +- nporadio2/notifications.py | 6 +++--- nporadio2/radiotrack.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nporadio2/__main__.py b/nporadio2/__main__.py index e76e33a..4df3022 100644 --- a/nporadio2/__main__.py +++ b/nporadio2/__main__.py @@ -16,7 +16,7 @@ def get_current_song(): ) data = result.json() - radio_tracks = data["data"]["radio_track_plays"]["data"][0]["radio_tracks"] + radio_tracks = data["data"]["radioTrackPlays"]["data"][0]["radioTracks"] track = RadioTrack(radio_tracks) return track diff --git a/nporadio2/notifications.py b/nporadio2/notifications.py index ed1a246..b648245 100644 --- a/nporadio2/notifications.py +++ b/nporadio2/notifications.py @@ -57,7 +57,7 @@ class SongNotification(UserNotification): url = NSURL.URLWithString_(f"file://{song.cover_path}") err = None - atachement = ( + attachment = ( UNNotificationAttachment.attachmentWithIdentifier_URL_options_error_( "", url, @@ -68,7 +68,7 @@ class SongNotification(UserNotification): if err: print(err) - atachement = None + attachment = None if top2000: title = f"{top2000.position}: {song.title}" @@ -78,5 +78,5 @@ class SongNotification(UserNotification): self.create_notification( title, song.artist, - attachments=[atachement], + attachments=[attachment], ) diff --git a/nporadio2/radiotrack.py b/nporadio2/radiotrack.py index 2dca05d..f218eb7 100644 --- a/nporadio2/radiotrack.py +++ b/nporadio2/radiotrack.py @@ -14,7 +14,7 @@ class RadioTrack: self.artist = data["artist"] self.title = data["name"] - self.cover = data["cover_url"] + self.cover = data["coverUrl"] self.cover_path: Optional[str] = None def save_image(self):