Patch from Ludek (http://www.dolejsky.com/2009/02/19/growltunes-patch/) which fixes display of radio streams. Thanks!
authorEvan Schoenberg
Thu Feb 26 06:36:43 2009 -0500 (2009-02-26)
changeset 41772776a948782a
parent 4176 f5ec2d3d58a0
child 4178 9ea7cd00514b
Patch from Ludek (http://www.dolejsky.com/2009/02/19/growltunes-patch/) which fixes display of radio streams. Thanks!
Extras/GrowlTunes/GrowlTunesController.m
     1.1 --- a/Extras/GrowlTunes/GrowlTunesController.m	Thu Nov 06 17:29:33 2008 -0500
     1.2 +++ b/Extras/GrowlTunes/GrowlTunesController.m	Thu Feb 26 06:36:43 2009 -0500
     1.3 @@ -405,7 +405,13 @@
     1.4  		artist      = [userInfo objectForKey:@"Artist"];
     1.5  		album       = [userInfo objectForKey:@"Album"];
     1.6  		composer	= [userInfo objectForKey:@"Composer"];
     1.7 -		track       = [[NSString alloc] initWithFormat:@"%@. %@", [userInfo objectForKey:@"Track Number"], [userInfo objectForKey:@"Name"]];
     1.8 +		
     1.9 +		if ([userInfo objectForKey:@"Track Number"]) {
    1.10 +			track = [[NSString alloc] initWithFormat:@"%@. %@", [userInfo objectForKey:@"Track Number"], [userInfo objectForKey:@"Name"]];
    1.11 +		} else {
    1.12 +			//track number is nil for radio streams, ignore it
    1.13 +			track = [userInfo objectForKey:@"Name"];
    1.14 +		}
    1.15  		genre       = [userInfo objectForKey:@"Genre"];
    1.16  		streamTitle = [userInfo objectForKey:@"Stream Title"];
    1.17  		if(!streamTitle)
    1.18 @@ -503,7 +509,12 @@
    1.19  			[GrowlApplicationBridge notifyWithDictionary:noteDict];
    1.20  
    1.21  			// Recent Tracks
    1.22 -			[self addTuneToRecentTracks:track fromPlaylist:playlistName];
    1.23 +			if (streamTitle && [streamTitle length]) {
    1.24 +				//streamed song - insert streamTitle (song name) rather than track (radio name)
    1.25 +				[self addTuneToRecentTracks:streamTitle fromPlaylist:playlistName];
    1.26 +			} else {
    1.27 +				[self addTuneToRecentTracks:track fromPlaylist:playlistName];
    1.28 +			}
    1.29  		}
    1.30  
    1.31  		// set up us some state for next time