[vlc-commits] [Git][videolan/vlc][master] macosx: Ensure the correct notifications are being emitted in VLCLibraryModel

Rémi Denis-Courmont (@Courmisch) gitlab at videolan.org
Tue Jun 21 14:29:55 UTC 2022



Rémi Denis-Courmont pushed to branch master at VideoLAN / VLC


Commits:
a91d9d8f by Claudio Cambra at 2022-06-21T14:01:34+00:00
macosx: Ensure the correct notifications are being emitted in VLCLibraryModel

Signed-off-by: Claudio Cambra <claudio.cambra at gmail.com>

- - - - -


3 changed files:

- modules/gui/macosx/library/VLCLibraryModel.h
- modules/gui/macosx/library/VLCLibraryModel.m
- modules/gui/macosx/library/VLCLibraryWindow.m


Changes:

=====================================
modules/gui/macosx/library/VLCLibraryModel.h
=====================================
@@ -35,6 +35,7 @@ NS_ASSUME_NONNULL_BEGIN
 extern NSString *VLCLibraryModelAudioMediaListUpdated;
 extern NSString *VLCLibraryModelArtistListUpdated;
 extern NSString *VLCLibraryModelAlbumListUpdated;
+extern NSString *VLCLibraryModelGenreListUpdated;
 extern NSString *VLCLibraryModelVideoMediaListUpdated;
 extern NSString *VLCLibraryModelRecentMediaListUpdated;
 extern NSString *VLCLibraryModelMediaItemUpdated;


=====================================
modules/gui/macosx/library/VLCLibraryModel.m
=====================================
@@ -29,6 +29,7 @@
 NSString *VLCLibraryModelAudioMediaListUpdated = @"VLCLibraryModelAudioMediaListUpdated";
 NSString *VLCLibraryModelArtistListUpdated = @"VLCLibraryModelArtistListUpdated";
 NSString *VLCLibraryModelAlbumListUpdated = @"VLCLibraryModelAlbumListUpdated";
+NSString *VLCLibraryModelGenreListUpdated = @"VLCLibraryModelGenreListUpdated";
 NSString *VLCLibraryModelVideoMediaListUpdated = @"VLCLibraryModelVideoMediaListUpdated";
 NSString *VLCLibraryModelRecentMediaListUpdated = @"VLCLibraryModelRecentMediaListUpdated";
 NSString *VLCLibraryModelMediaItemUpdated = @"VLCLibraryModelMediaItemUpdated";
@@ -242,7 +243,7 @@ static void libraryCallback(void *p_data, const vlc_ml_event_t *p_event)
         vlc_ml_album_list_release(p_album_list);
         dispatch_async(dispatch_get_main_queue(), ^{
             self->_cachedAlbums = [mutableArray copy];
-            [self->_defaultNotificationCenter postNotificationName:VLCLibraryModelArtistListUpdated object:self];
+            [self->_defaultNotificationCenter postNotificationName:VLCLibraryModelAlbumListUpdated object:self];
         });
     });
 }
@@ -276,7 +277,7 @@ static void libraryCallback(void *p_data, const vlc_ml_event_t *p_event)
         vlc_ml_genre_list_release(p_genre_list);
         dispatch_async(dispatch_get_main_queue(), ^{
             self->_cachedGenres = [mutableArray copy];
-            [self->_defaultNotificationCenter postNotificationName:VLCLibraryModelArtistListUpdated object:self];
+            [self->_defaultNotificationCenter postNotificationName:VLCLibraryModelGenreListUpdated object:self];
         });
     });
 }


=====================================
modules/gui/macosx/library/VLCLibraryWindow.m
=====================================
@@ -216,6 +216,10 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
                            selector:@selector(updateLibraryRepresentation:)
                                name:VLCLibraryModelAlbumListUpdated
                              object:nil];
+    [notificationCenter addObserver:self
+                           selector:@selector(updateLibraryRepresentation:)
+                               name:VLCLibraryModelGenreListUpdated
+                             object:nil];
     [notificationCenter addObserver:self
                            selector:@selector(updateLibraryRepresentation:)
                                name:VLCLibraryModelVideoMediaListUpdated



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/a91d9d8f6e05f7bc63f9e656e2ea6e7a1dea1ac3

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/a91d9d8f6e05f7bc63f9e656e2ea6e7a1dea1ac3
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list