From 9866c24b9f24364576a2861d93d40b31dcb654b3 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Sat, 22 Sep 2018 03:10:44 -0700 Subject: [PATCH] Fix refreshing table values when adding tracks to the playlist. --- Playlist/PlaylistLoader.m | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Playlist/PlaylistLoader.m b/Playlist/PlaylistLoader.m index 315e14cfe..e3630d252 100755 --- a/Playlist/PlaylistLoader.m +++ b/Playlist/PlaylistLoader.m @@ -534,7 +534,15 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc } [playlistController performSelectorOnMainThread:@selector(updateTotalTime) withObject:nil waitUntilDone:NO]; - [playlistView performSelectorOnMainThread:@selector(reloadDataForRowIndexes:columnIndexes:) withObject:@[update_indexes,[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, 63)]] waitUntilDone:NO]; + + { + __block NSScrollView *weakPlaylistView = playlistView; + __block NSIndexSet *weakIndexSet = update_indexes; + dispatch_sync_reentrant(dispatch_get_main_queue(), ^{ + unsigned long columns = [[[weakPlaylistView documentView] tableColumns] count]; + [weakPlaylistView.documentView reloadDataForRowIndexes:weakIndexSet columnIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0,columns-1)]]; + }); + } } - (void)clear:(id)sender