Browse Source

macosx: Fix presenting item in current audio library segment

Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
pull/178/head
Claudio Cambra 1 year ago
committed by Felix Paul Kühne
parent
commit
34ed2bd42c
  1. 9
      modules/gui/macosx/library/audio-library/VLCLibraryAudioViewController.m

9
modules/gui/macosx/library/audio-library/VLCLibraryAudioViewController.m

@ -459,7 +459,7 @@ NSString *VLCLibraryPlaceholderAudioViewIdentifier = @"VLCLibraryPlaceholderAudi
}
}
- (void)presentLibraryItemWaitForDataSourceFinished:(NSNotification *)aNotification
- (void)presentLibraryItemWaitForDataSourceFinished:(nullable NSNotification *)aNotification
{
if (self.audioDataSource.displayedCollectionCount < self.audioDataSource.collectionToDisplayCount) {
return;
@ -502,12 +502,17 @@ NSString *VLCLibraryPlaceholderAudioViewIdentifier = @"VLCLibraryPlaceholderAudi
segmentType = VLCLibrarySongsMusicSubSegmentType;
}
VLCLibraryWindow * const libraryWindow = self.libraryWindow;
if (segmentType == libraryWindow.librarySegmentType) {
[self presentLibraryItemWaitForDataSourceFinished:nil];
return;
}
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(presentLibraryItemWaitForDataSourceFinished:)
name:VLCLibraryAudioDataSourceDisplayedCollectionChangedNotification
object:self.audioDataSource];
VLCLibraryWindow * const libraryWindow = self.libraryWindow;
libraryWindow.librarySegmentType = segmentType;
[libraryWindow.splitViewController.navSidebarViewController selectSegment:segmentType];
}

Loading…
Cancel
Save