Dont force unwrap author and title

This commit is contained in:
Jackson Harper 2022-08-25 20:11:39 +08:00
parent 809acd4e8b
commit 169149b3e1

View file

@ -296,8 +296,8 @@ public class AudioSession: NSObject, ObservableObject, AVAudioPlayerDelegate {
if let item = item {
MPNowPlayingInfoCenter.default().nowPlayingInfo = [
MPMediaItemPropertyTitle: NSString(string: item.title!),
MPMediaItemPropertyArtist: NSString(string: item.author!),
MPMediaItemPropertyTitle: NSString(string: item.title ?? "Your Omnivore Article"),
MPMediaItemPropertyArtist: NSString(string: item.author ?? "Omnivore"),
MPMediaItemPropertyPlaybackDuration: NSNumber(value: duration),
MPNowPlayingInfoPropertyElapsedPlaybackTime: NSNumber(value: timeElapsed)
]