Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
3cfbeb03 by Claudio Cambra at 2026-03-01T22:53:11+01:00
macosx: Simplify setRepresentedAudioGroup in audio group data source, leverage 
property

Signed-off-by: Claudio Cambra <[email protected]>

- - - - -
b8148a85 by Claudio Cambra at 2026-03-01T22:53:11+01:00
macosx: Remove incorrect whitespaces in audio group data source

Signed-off-by: Claudio Cambra <[email protected]>

- - - - -


1 changed file:

- modules/gui/macosx/library/audio-library/VLCLibraryAudioGroupDataSource.m


Changes:

=====================================
modules/gui/macosx/library/audio-library/VLCLibraryAudioGroupDataSource.m
=====================================
@@ -290,16 +290,7 @@
         }
 
         _representedAudioGroup = representedAudioGroup;
-
-        if ([representedAudioGroup isKindOfClass:VLCMediaLibraryAlbum.class]) {
-            _currentParentType = VLCMediaLibraryParentGroupTypeAlbum;
-        } else if ([representedAudioGroup 
isKindOfClass:VLCMediaLibraryArtist.class]) {
-            _currentParentType = VLCMediaLibraryParentGroupTypeArtist;
-        } else if ([representedAudioGroup 
isKindOfClass:VLCMediaLibraryGenre.class]) {
-            _currentParentType = VLCMediaLibraryParentGroupTypeGenre;
-        } else {
-            NSAssert(1, @"Current parent type should be a valid audio group 
type");
-        }
+        _currentParentType = representedAudioGroup.matchingParentType;
 
         [self updateRepresentedListOfAlbums];
     }
@@ -431,14 +422,14 @@ 
viewForSupplementaryElementOfKind:(NSCollectionViewSupplementaryElementKind)kind
 - (NSArray<VLCLibraryRepresentedItem *> 
*)representedItemsAtIndexPaths:(NSSet<NSIndexPath *> *const)indexPaths
                                                      
forCollectionView:(NSCollectionView *)collectionView
 {
-    NSMutableArray<VLCLibraryRepresentedItem *> * const representedItems = 
+    NSMutableArray<VLCLibraryRepresentedItem *> * const representedItems =
         [NSMutableArray arrayWithCapacity:indexPaths.count];
-    
+
     for (NSIndexPath * const indexPath in indexPaths) {
-        const id<VLCMediaLibraryItemProtocol> libraryItem = 
+        const id<VLCMediaLibraryItemProtocol> libraryItem =
             [self libraryItemAtIndexPath:indexPath 
forCollectionView:collectionView];
-        VLCLibraryRepresentedItem * const representedItem = 
-            [[VLCLibraryRepresentedItem alloc] initWithItem:libraryItem 
+        VLCLibraryRepresentedItem * const representedItem =
+            [[VLCLibraryRepresentedItem alloc] initWithItem:libraryItem
                                                  
parentType:self.currentParentType];
         [representedItems addObject:representedItem];
     }



View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/compare/0a4b3c60022138373fa21af03af79c2762ef5567...b8148a855da7c21dfa754aaebf3a8a8fc4b812ec

-- 
View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/compare/0a4b3c60022138373fa21af03af79c2762ef5567...b8148a855da7c21dfa754aaebf3a8a8fc4b812ec
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance
_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to