No longer send '(null)' notifications for files missing artist and/or album tags.
parent
d14d69e3c4
commit
3901305105
|
@ -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:)]) {
|
||||
|
|
Loading…
Reference in New Issue