From 8d4758fc5fd9dc0ab891c76e011fbf95ef46c0ad Mon Sep 17 00:00:00 2001 From: Mohamed Afifi Date: Sun, 15 Sep 2024 21:27:37 -0400 Subject: [PATCH] Use AppIcon as an asset in the Now Playing widget (#663) --- Core/QueuePlayer/PlayerItemInfo.swift | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Core/QueuePlayer/PlayerItemInfo.swift b/Core/QueuePlayer/PlayerItemInfo.swift index 420a8351..02fd6e70 100644 --- a/Core/QueuePlayer/PlayerItemInfo.swift +++ b/Core/QueuePlayer/PlayerItemInfo.swift @@ -25,10 +25,8 @@ public struct PlayerItemInfo { public init(title: String, artist: String, image: UIImage?) { self.title = title self.artist = artist - if let image { - artwork = MPMediaItemArtwork(boundsSize: image.size) { _ in image } - } else { - artwork = nil + artwork = (image ?? UIImage(named: "AppIcon")).map { image in + MPMediaItemArtwork(boundsSize: image.size) { _ in image } } }