mirror of
https://github.com/danbee/persephone
synced 2025-03-04 08:39:11 +00:00
Show album art on notification
This commit is contained in:
parent
e441d7b0d6
commit
4094fc19ea
@ -47,7 +47,6 @@ class QueueViewController: NSViewController,
|
|||||||
else { return }
|
else { return }
|
||||||
|
|
||||||
dataSource.setQueueIcon(state)
|
dataSource.setQueueIcon(state)
|
||||||
notifyTrack()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func notifyTrack() {
|
func notifyTrack() {
|
||||||
@ -59,6 +58,7 @@ class QueueViewController: NSViewController,
|
|||||||
let notification = NSUserNotification()
|
let notification = NSUserNotification()
|
||||||
notification.title = currentSong.title
|
notification.title = currentSong.title
|
||||||
notification.subtitle = "\(currentSong.artist) — \(currentSong.album.title)"
|
notification.subtitle = "\(currentSong.artist) — \(currentSong.album.title)"
|
||||||
|
notification.contentImage = queueAlbumArtImage.image
|
||||||
|
|
||||||
NSUserNotificationCenter.default.deliver(notification)
|
NSUserNotificationCenter.default.deliver(notification)
|
||||||
}
|
}
|
||||||
@ -91,6 +91,8 @@ class QueueViewController: NSViewController,
|
|||||||
} else {
|
} else {
|
||||||
self.queueAlbumArtImage.image = NSImage.defaultCoverArt
|
self.queueAlbumArtImage.image = NSImage.defaultCoverArt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.notifyTrack()
|
||||||
}
|
}
|
||||||
.cauterize()
|
.cauterize()
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user