Created
July 20, 2024 18:40
-
-
Save PhrantiK/3b2dcc59c5f340cd214cf474af988dfd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/src/media.m b/src/media.m | |
| index c9d6ac9..aef481f 100644 | |
| --- a/src/media.m | |
| +++ b/src/media.m | |
| @@ -115,9 +115,12 @@ - (void)media_change:(NSNotification *)notification { | |
| if (!g_media_events) return; | |
| MRMediaRemoteGetNowPlayingApplicationDisplayName(0, dispatch_get_main_queue(), ^(CFStringRef name) { | |
| @autoreleasepool { | |
| + | |
| + NSString* app = [(NSString*)CFBridgingRelease(name) copy]; | |
| + | |
| MRMediaRemoteGetNowPlayingInfo(dispatch_get_main_queue(), ^(NSDictionary* dict) { | |
| @autoreleasepool { | |
| - if (dict && name) { | |
| + if (dict && app) { | |
| NSString* app = (NSString*)name; | |
| NSString* artist = [dict objectForKey:kMRMediaRemoteNowPlayingInfoArtist]; | |
| NSString* title = [dict objectForKey:kMRMediaRemoteNowPlayingInfoTitle]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment