[Playlist Metadata] Apply metadata correctly

Apply dynamic metadata update refreshes to the correct track index.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
swiftingly
Christopher Snowhill 2022-06-17 10:24:45 -07:00
parent ab32365c45
commit c7cd9b6daf
3 changed files with 8 additions and 2 deletions

View File

@ -681,7 +681,7 @@ NSDictionary *makeRGInfo(PlaylistEntry *pe) {
PlaylistEntry *pe = (PlaylistEntry *)userInfo;
if (!pe) pe = [playlistController currentEntry];
[pe setMetadata:info];
[playlistView refreshCurrentTrack:self];
[playlistView refreshTrack:pe];
// Delay the action until this function has returned to the audio thread
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 5 * NSEC_PER_MSEC), dispatch_get_main_queue(), ^{
[self sendMetaData];

View File

@ -25,5 +25,6 @@
- (IBAction)scrollToCurrentEntry:(id)sender;
- (IBAction)refreshCurrentTrack:(id)sender;
- (IBAction)refreshTrack:(id)sender;
@end

View File

@ -411,8 +411,13 @@
}
- (IBAction)refreshCurrentTrack:(id)sender {
[self refreshTrack:[playlistController currentEntry]];
}
- (IBAction)refreshTrack:(id)sender {
PlaylistEntry *pe = (PlaylistEntry *)sender;
unsigned long columns = [[self tableColumns] count];
[self reloadDataForRowIndexes:[NSIndexSet indexSetWithIndex:[[playlistController currentEntry] index]] columnIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, columns)]];
[self reloadDataForRowIndexes:[NSIndexSet indexSetWithIndex:[pe index]] columnIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, columns)]];
}
#if 0