No longer send '(null)' notifications for files missing artist and/or album tags.

CQTexperiment
Christopher Snowhill 2018-06-03 18:39:07 -07:00
parent d14d69e3c4
commit 3901305105
1 changed files with 13 additions and 2 deletions

View File

@ -122,12 +122,23 @@ typedef enum
NSUserNotification *notif = [[NSUserNotification alloc] init];
notif.title = [pe title];
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];
} else {
subtitle = @"";
}
if ([defaults boolForKey:@"notifications.itunes-style"]) {
notif.subtitle = [NSString stringWithFormat:@"%@ - %@", [pe artist], [pe album]];
notif.subtitle = subtitle;
[notif setValue:@YES forKey:@"_showsButtons"];
}
else {
notif.informativeText = [NSString stringWithFormat:@"%@ - %@", [pe artist], [pe album]];
notif.informativeText = subtitle;
}
if ([notif respondsToSelector:@selector(setContentImage:)]) {