From 404d3549186f02f464db4afc5912e81cc6f42d0e Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Sat, 18 Jun 2022 19:03:25 -0700 Subject: [PATCH] [Playback Notifications] Fix empty hyphen on tags This change needed to be applied in two places, oops, forgot the modern macOS case. Signed-off-by: Christopher Snowhill --- Application/PlaybackEventController.m | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Application/PlaybackEventController.m b/Application/PlaybackEventController.m index 3b041934d..2cdef275c 100644 --- a/Application/PlaybackEventController.m +++ b/Application/PlaybackEventController.m @@ -177,12 +177,14 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response content.title = @"Now Playing"; NSString *subtitle; - if([pe artist] && [pe album]) { - subtitle = [NSString stringWithFormat:@"%@ - %@", [pe artist], [pe album]]; - } else if([pe artist]) { - subtitle = [pe artist]; - } else if([pe album]) { - subtitle = [pe album]; + NSString *artist = (pe.artist && [pe.artist length]) ? pe.artist : nil; + NSString *album = (pe.album && [pe.album length]) ? pe.album : nil; + if(artist && album) { + subtitle = [NSString stringWithFormat:@"%@ - %@", artist, album]; + } else if(artist) { + subtitle = artist; + } else if(album) { + subtitle = album; } else { subtitle = @""; }