[vlc-commits] [Git][videolan/vlc][master] macosx: fix playlist library search refresh
Steve Lhomme (@robUx4)
gitlab at videolan.org
Mon Aug 3 19:16:34 UTC 2026
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
57fbf66f by Serhii Bykov at 2026-08-03T18:33:58+00:00
macosx: fix playlist library search refresh
- - - - -
1 changed file:
- modules/gui/macosx/library/playlist-library/VLCLibraryPlaylistViewController.m
Changes:
=====================================
modules/gui/macosx/library/playlist-library/VLCLibraryPlaylistViewController.m
=====================================
@@ -79,6 +79,10 @@
selector:@selector(libraryModelUpdated:)
name:VLCLibraryModelPlaylistAdded
object:nil];
+ [notificationCenter addObserver:self
+ selector:@selector(libraryModelUpdated:)
+ name:VLCLibraryModelAllCachesDropped
+ object:nil];
[notificationCenter addObserver:self
selector:@selector(libraryModelPlaylistDeleted:)
name:VLCLibraryModelPlaylistDeleted
@@ -285,6 +289,7 @@
{
const vlc_ml_playlist_type_t playlistType = self.dataSource.playlistType;
VLCLibraryModel * const libraryModel = VLCMain.sharedInstance.libraryController.libraryModel;
+ [self.dataSource reloadData];
if ([libraryModel numberOfPlaylistsOfType:playlistType] > 0) {
[self presentPlaylistLibraryView];
} else if (self.dataSource.libraryModel.filterString.length > 0) {
@@ -310,9 +315,16 @@
VLCLibraryModel * const model = VLCMain.sharedInstance.libraryController.libraryModel;
const vlc_ml_playlist_type_t playlistType = self.dataSource.playlistType;
const size_t numberOfPlaylists = [model numberOfPlaylistsOfType:playlistType];
-
- if (self.libraryWindow.librarySegmentType == VLCLibraryPlaylistsSegmentType &&
- ((numberOfPlaylists == 0 && ![self.libraryWindow.libraryTargetView.subviews containsObject:self.libraryWindow.emptyLibraryView]) ||
+ const BOOL isPlaylistSegmentActive =
+ self.libraryWindow.librarySegmentType == VLCLibraryPlaylistsSegmentType ||
+ self.libraryWindow.librarySegmentType == VLCLibraryPlaylistsMusicOnlyPlaylistsSubSegmentType ||
+ self.libraryWindow.librarySegmentType == VLCLibraryPlaylistsVideoOnlyPlaylistsSubSegmentType;
+ const BOOL shouldRefreshForFilterChange =
+ [notification.name isEqualToString:VLCLibraryModelAllCachesDropped];
+
+ if (isPlaylistSegmentActive &&
+ (shouldRefreshForFilterChange ||
+ (numberOfPlaylists == 0 && ![self.libraryWindow.libraryTargetView.subviews containsObject:self.libraryWindow.emptyLibraryView]) ||
(numberOfPlaylists > 0 && ![self.libraryWindow.libraryTargetView.subviews containsObject:_collectionViewScrollView])) &&
!self.libraryWindow.embeddedVideoPlaybackActive) {
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/57fbf66fb806119e08c36f7a3adf8cdb4423f019
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/57fbf66fb806119e08c36f7a3adf8cdb4423f019
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