Skip to content

Commit

Permalink
Check for empty MB results
Browse files Browse the repository at this point in the history
  • Loading branch information
sbooth committed Feb 27, 2020
1 parent 1a32084 commit 296d0ee
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CompactDisc/CompactDiscDocument.m
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,11 @@ - (IBAction) queryMusicBrainz:(id)sender
return;

PerformMusicBrainzQuery([[self disc] discID], ^(NSArray *results) {
if(0 == [results count]) {
return;
}
// If only match was found, update ourselves
if(1 == [results count]) {
else if(1 == [results count]) {
NSDictionary *release = [results firstObject];
[self updateMetadataFromMusicBrainz:release];
NSString *releaseID = [release objectForKey:@"albumId"];
Expand Down Expand Up @@ -558,7 +561,6 @@ - (IBAction) toggleMetadataInspectorPanel:(id)sender
else {
[_metadataPanel orderOut:sender];
}

}

- (IBAction) selectNextTrack:(id)sender { [_trackController selectNext:sender]; }
Expand Down

0 comments on commit 296d0ee

Please sign in to comment.