mamburu: Only launch last.fm client if it isn't already running (prevents last.fm client's window from popping up on Cog restarts)
parent
73524776e7
commit
d98b5549d1
|
@ -73,8 +73,21 @@ escapeForLastFM(NSString *string)
|
||||||
|
|
||||||
_pluginID = @"cog";
|
_pluginID = @"cog";
|
||||||
|
|
||||||
if([[NSUserDefaults standardUserDefaults] boolForKey:@"automaticallyLaunchLastFM"])
|
if([[NSUserDefaults standardUserDefaults] boolForKey:@"automaticallyLaunchLastFM"]) {
|
||||||
[[NSWorkspace sharedWorkspace] launchApplication:@"Last.fm.app"];
|
|
||||||
|
NSArray *launchedApps = [[NSWorkspace sharedWorkspace] runningApplications];
|
||||||
|
BOOL running = NO;
|
||||||
|
for(NSRunningApplication *app in launchedApps) {
|
||||||
|
if([[app bundleIdentifier] isEqualToString:@"fm.last.Last.fm"]) {
|
||||||
|
running = YES;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!running) {
|
||||||
|
[[NSWorkspace sharedWorkspace] launchApplication:@"Last.fm.app"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_keepProcessingAudioScrobblerCommands = YES;
|
_keepProcessingAudioScrobblerCommands = YES;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue