[vlc-commits] [Git][videolan/vlc][master] 2 commits: macos: fix empty state gating for audio library sections

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon Sep 7 05:30:44 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
108f8417 by Serhii Bykov at 2026-09-07T05:09:37+00:00
macos: fix empty state gating for audio library sections

- - - - -
951c204a by Serhii Bykov at 2026-09-07T05:09:37+00:00
macos: refine audio library search presentation

- - - - -


2 changed files:

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


Changes:

=====================================
modules/gui/macosx/library/audio-library/VLCLibraryAudioDataSource.m
=====================================
@@ -82,6 +82,7 @@ NSString * const VLCLibraryAudioDataSourceDisplayedCollectionChangedNotification
 @interface VLCLibraryAudioDataSource () <NSMenuDelegate>
 
 @property (readwrite, atomic) NSMutableArray *displayedCollection;
+ at property (readonly) BOOL isSearchActive;
 @property (readonly) BOOL displayAllArtistsGenresTableEntry;
 @property (readwrite, strong) NSMenu *songsTableHeaderMenu;
 
@@ -724,6 +725,18 @@ NSString * const VLCLibraryAudioDataSourceDisplayedCollectionChangedNotification
             }
         }
 
+        if (self.isSearchActive &&
+            (self.currentParentType == VLCMediaLibraryParentGroupTypeArtist ||
+             self.currentParentType == VLCMediaLibraryParentGroupTypeAlbum ||
+             self.currentParentType == VLCMediaLibraryParentGroupTypeGenre) &&
+            self.displayedCollection.count > 0 &&
+            self.collectionSelectionTableView.selectedRow < 0 &&
+            self.gridModeListTableView.selectedRow < 0) {
+            NSIndexSet * const firstRowIndexSet = [NSIndexSet indexSetWithIndex:0];
+            [self tableView:collectionSelectionTableView selectRowIndices:firstRowIndexSet];
+            [self tableView:gridModeListTableView selectRowIndices:firstRowIndexSet];
+        }
+
         [NSNotificationCenter.defaultCenter postNotificationName:VLCLibraryAudioDataSourceDisplayedCollectionChangedNotification object:self];
     });
 }
@@ -824,10 +837,16 @@ NSString * const VLCLibraryAudioDataSourceDisplayedCollectionChangedNotification
 
 #pragma mark - table view data source and delegation
 
+- (BOOL)isSearchActive
+{
+    return self.libraryModel.filterString.length > 0;
+}
+
 - (BOOL)displayAllArtistsGenresTableEntry
 {
-    return self.currentParentType == VLCMediaLibraryParentGroupTypeGenre ||
-           self.currentParentType == VLCMediaLibraryParentGroupTypeArtist;
+    return !self.isSearchActive &&
+           (self.currentParentType == VLCMediaLibraryParentGroupTypeGenre ||
+            self.currentParentType == VLCMediaLibraryParentGroupTypeArtist);
 }
 
 - (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView


=====================================
modules/gui/macosx/library/audio-library/VLCLibraryAudioViewController.m
=====================================
@@ -411,9 +411,9 @@ NSString *VLCLibraryPlaceholderAudioViewIdentifier = @"VLCLibraryPlaceholderAudi
 - (void)updatePresentedView
 {
     self.audioDataSource.audioLibrarySegment = [self currentLibrarySegmentToAudioLibrarySegment];
-    const BOOL anyAudioMedia = self.audioDataSource.libraryModel.numberOfAudioMedia > 0;
+    const BOOL hasResultsForCurrentSegment = self.audioDataSource.collectionToDisplayCount > 0;
 
-    if (anyAudioMedia) {
+    if (hasResultsForCurrentSegment) {
         [self.libraryWindow displayLibraryView:self.audioLibraryView];
         [self hideAllViews];
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a55abb8875561af862fa0af8908b9eef9d09d14a...951c204a3ddb310e70de1340b5e6555d0fd7ce72

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a55abb8875561af862fa0af8908b9eef9d09d14a...951c204a3ddb310e70de1340b5e6555d0fd7ce72
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list