mirror of
https://code.videolan.org/videolan/vlc
synced 2024-10-03 01:31:53 +02:00
macosx: Display all albums when clicking on 'All items' table entry
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
This commit is contained in:
parent
860e7ab5d8
commit
406ab6c1d1
@ -566,15 +566,21 @@ static NSString *VLCLibraryYearSortDescriptorKey = @"VLCLibraryYearSortDescripto
|
||||
NSParameterAssert(notification);
|
||||
NSTableView *tableView = (NSTableView *)notification.object;
|
||||
NSInteger selectedRow = tableView.selectedRow;
|
||||
NSInteger libraryItemIndex = [self displayAllArtistsGenresTableEntry] ? selectedRow - 1 : selectedRow;
|
||||
id<VLCMediaLibraryItemProtocol> libraryItem = _displayedCollection[libraryItemIndex];
|
||||
BOOL showingAllItemsEntry = [self displayAllArtistsGenresTableEntry];
|
||||
NSInteger libraryItemIndex = showingAllItemsEntry ? selectedRow - 1 : selectedRow;
|
||||
|
||||
if (_currentParentType == VLC_ML_PARENT_ALBUM) {
|
||||
_groupDataSource.representedListOfAlbums = @[(VLCMediaLibraryAlbum *)libraryItem];
|
||||
} else if(_currentParentType != VLC_ML_PARENT_UNKNOWN) {
|
||||
_groupDataSource.representedListOfAlbums = [_libraryModel listAlbumsOfParentType:_currentParentType forID:libraryItem.libraryID];
|
||||
} else { // FIXME: we have nothing to show here
|
||||
_groupDataSource.representedListOfAlbums = nil;
|
||||
if (libraryItemIndex < 0 && showingAllItemsEntry) {
|
||||
_groupDataSource.representedListOfAlbums = _libraryModel.listOfAlbums;
|
||||
} else {
|
||||
id<VLCMediaLibraryItemProtocol> libraryItem = _displayedCollection[libraryItemIndex];
|
||||
|
||||
if (_currentParentType == VLC_ML_PARENT_ALBUM) {
|
||||
_groupDataSource.representedListOfAlbums = @[(VLCMediaLibraryAlbum *)libraryItem];
|
||||
} else if(_currentParentType != VLC_ML_PARENT_UNKNOWN) {
|
||||
_groupDataSource.representedListOfAlbums = [_libraryModel listAlbumsOfParentType:_currentParentType forID:libraryItem.libraryID];
|
||||
} else { // FIXME: we have nothing to show here
|
||||
_groupDataSource.representedListOfAlbums = nil;
|
||||
}
|
||||
}
|
||||
|
||||
[self.groupSelectionTableView reloadData];
|
||||
|
Loading…
Reference in New Issue
Block a user