Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to load embedded lyrics first #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions DynamicLyrics/LyricX/MainController.m
Original file line number Diff line number Diff line change
Expand Up @@ -230,16 +230,24 @@ - (void) WorkingThread:(NSMutableDictionary*)tmpDict

NSString *SongTitle = [iTunesCurrentTrack name];
NSString *SongArtist = [iTunesCurrentTrack artist];
NSString *SongEmbeddedLyrics = [iTunesCurrentTrack lyrics];

if(SongTitle == nil) {
self.CurrentSongLyrics = @"";
}else{
self.CurrentSongLyrics = [NSString stringWithFormat:@"%@ - %@",SongTitle,SongArtist];
}
[nc postNotificationName:@"LyricsChanged" object:self userInfo:[NSDictionary dictionaryWithObject:self.CurrentSongLyrics forKey:@"Lyrics"]];


if ([userDefaults valueForKey:[NSString stringWithFormat:@"%@%@",SongArtist,SongTitle]])

if([SongEmbeddedLyrics length] != 0){
self.SongLyrics = SongEmbeddedLyrics;
CurrentLyric = 0;
LyricsDelay = [userDefaults floatForKey:[NSString stringWithFormat:@"Delay%@%@",SongArtist,SongTitle]];
[currentDelayMenuItem setTitle:[NSString stringWithFormat:@"%@ %.2fs",NSLocalizedString(@"CurrentDelay", nil),0 - LyricsDelay]];

[self Anylize];
}
else if ([userDefaults valueForKey:[NSString stringWithFormat:@"%@%@",SongArtist,SongTitle]])
{
self.SongLyrics = [NSString stringWithString:[userDefaults valueForKey:[NSString stringWithFormat:@"%@%@",SongArtist,SongTitle]]];

Expand Down