No longer send '(null)' notifications for files missing artist and/or album tags.
parent
fdf3ae9b29
commit
4ebde0d584
|
@ -122,12 +122,23 @@ typedef enum
|
||||||
NSUserNotification *notif = [[NSUserNotification alloc] init];
|
NSUserNotification *notif = [[NSUserNotification alloc] init];
|
||||||
notif.title = [pe title];
|
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"]) {
|
if ([defaults boolForKey:@"notifications.itunes-style"]) {
|
||||||
notif.subtitle = [NSString stringWithFormat:@"%@ - %@", [pe artist], [pe album]];
|
notif.subtitle = subtitle;
|
||||||
[notif setValue:@YES forKey:@"_showsButtons"];
|
[notif setValue:@YES forKey:@"_showsButtons"];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
notif.informativeText = [NSString stringWithFormat:@"%@ - %@", [pe artist], [pe album]];
|
notif.informativeText = subtitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ([notif respondsToSelector:@selector(setContentImage:)]) {
|
if ([notif respondsToSelector:@selector(setContentImage:)]) {
|
||||||
|
|
Loading…
Reference in New Issue