macosx: Adapt all items entry text to current audio group type

Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
This commit is contained in:
Claudio Cambra 2022-12-26 18:02:13 +01:00 committed by Jean-Baptiste Kempf
parent 406ab6c1d1
commit 1cc3ce63a8
1 changed files with 10 additions and 5 deletions

View File

@ -550,11 +550,16 @@ static NSString *VLCLibraryYearSortDescriptorKey = @"VLCLibraryYearSortDescripto
- (id<VLCMediaLibraryItemProtocol>)libraryItemAtRow:(NSInteger)row
forTableView:(NSTableView *)tableView
{
if ([self displayAllArtistsGenresTableEntry]) {
if (row == 0) {
return [[VLCMediaLibraryDummyItem alloc] initWithDisplayString:_NS("All items")
withDetailString:@""];
}
BOOL viewDisplayingAllItemsEntry = [self displayAllArtistsGenresTableEntry];
BOOL provideAllItemsEntry = viewDisplayingAllItemsEntry && row == 0;
if (provideAllItemsEntry && _currentParentType == VLC_ML_PARENT_GENRE) {
return [[VLCMediaLibraryDummyItem alloc] initWithDisplayString:_NS("All genres")
withDetailString:@""];
} else if (provideAllItemsEntry && _currentParentType == VLC_ML_PARENT_ARTIST) {
return [[VLCMediaLibraryDummyItem alloc] initWithDisplayString:_NS("All artists")
withDetailString:@""];
} else if (viewDisplayingAllItemsEntry) {
return _displayedCollection[row - 1];
}