Update
This commit is contained in:
@@ -16,7 +16,7 @@ def get_current_song():
|
|||||||
)
|
)
|
||||||
|
|
||||||
data = result.json()
|
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)
|
track = RadioTrack(radio_tracks)
|
||||||
return track
|
return track
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ class SongNotification(UserNotification):
|
|||||||
|
|
||||||
url = NSURL.URLWithString_(f"file://{song.cover_path}")
|
url = NSURL.URLWithString_(f"file://{song.cover_path}")
|
||||||
err = None
|
err = None
|
||||||
atachement = (
|
attachment = (
|
||||||
UNNotificationAttachment.attachmentWithIdentifier_URL_options_error_(
|
UNNotificationAttachment.attachmentWithIdentifier_URL_options_error_(
|
||||||
"",
|
"",
|
||||||
url,
|
url,
|
||||||
@@ -68,7 +68,7 @@ class SongNotification(UserNotification):
|
|||||||
|
|
||||||
if err:
|
if err:
|
||||||
print(err)
|
print(err)
|
||||||
atachement = None
|
attachment = None
|
||||||
|
|
||||||
if top2000:
|
if top2000:
|
||||||
title = f"{top2000.position}: {song.title}"
|
title = f"{top2000.position}: {song.title}"
|
||||||
@@ -78,5 +78,5 @@ class SongNotification(UserNotification):
|
|||||||
self.create_notification(
|
self.create_notification(
|
||||||
title,
|
title,
|
||||||
song.artist,
|
song.artist,
|
||||||
attachments=[atachement],
|
attachments=[attachment],
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class RadioTrack:
|
|||||||
|
|
||||||
self.artist = data["artist"]
|
self.artist = data["artist"]
|
||||||
self.title = data["name"]
|
self.title = data["name"]
|
||||||
self.cover = data["cover_url"]
|
self.cover = data["coverUrl"]
|
||||||
self.cover_path: Optional[str] = None
|
self.cover_path: Optional[str] = None
|
||||||
|
|
||||||
def save_image(self):
|
def save_image(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user