[vlc-commits] [Git][videolan/vlc][master] macosx: Avoid passing invalid parent type into listAlbumsOfParentType
Felix Paul Kühne (@fkuehne)
gitlab at videolan.org
Sun Jul 5 16:06:48 UTC 2026
Felix Paul Kühne pushed to branch master at VideoLAN / VLC
Commits:
07d50efd by Claudio Cambra at 2026-07-05T17:56:46+02:00
macosx: Avoid passing invalid parent type into listAlbumsOfParentType
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
1 changed file:
- modules/gui/macosx/library/audio-library/VLCLibraryAudioGroupDataSource.m
Changes:
=====================================
modules/gui/macosx/library/audio-library/VLCLibraryAudioGroupDataSource.m
=====================================
@@ -40,8 +40,6 @@
#import "views/VLCSubScrollView.h"
-#import "library/VLCLibrarySegment.h"
-
@interface VLCLibraryAudioGroupDataSource ()
{
id<VLCMediaLibraryAudioGroupProtocol> _representedAudioGroup;
@@ -289,21 +287,14 @@
if (self.representedAudioGroup == nil || self.currentParentType == VLCMediaLibraryParentGroupTypeUnknown) {
albums = libraryModel.listOfAlbums;
} else if (self.representedAudioGroup.albums.count == 0) {
- const VLCLibrarySegmentType currentType = VLCMain.sharedInstance.libraryWindow.librarySegmentType;
- enum vlc_ml_parent_type realParentType = VLC_ML_PARENT_UNKNOWN;
- switch (currentType) {
- case VLCLibraryMusicSegmentType:
- case VLCLibraryArtistsMusicSubSegmentType:
- realParentType = VLC_ML_PARENT_ARTIST;
- break;
- case VLCLibraryGenresMusicSubSegmentType:
- realParentType = VLC_ML_PARENT_GENRE;
- break;
- default:
- realParentType = VLC_ML_PARENT_UNKNOWN;
- break;
+ const VLCMediaLibraryParentGroupType parentType = self.currentParentType;
+ if (parentType == VLCMediaLibraryParentGroupTypeArtist ||
+ parentType == VLCMediaLibraryParentGroupTypeGenre) {
+ albums = [libraryModel listAlbumsOfParentType:(enum vlc_ml_parent_type)parentType
+ forID:self.representedAudioGroup.libraryID];
+ } else {
+ albums = libraryModel.listOfAlbums;
}
- albums = [libraryModel listAlbumsOfParentType:realParentType forID:self.representedAudioGroup.libraryID];
} else {
albums = self.representedAudioGroup.albums;
}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/07d50efd1027d735512cbfcea81252aba1f6ba02
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/07d50efd1027d735512cbfcea81252aba1f6ba02
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