Skip to content
Snippets Groups Projects
Commit bb73bd05 authored by Claudio Cambra's avatar Claudio Cambra Committed by Felix Paul Kühne
Browse files

macosx: Implement indexPathForLibraryItem in shows data source


Signed-off-by: default avatarClaudio Cambra <developer@claudiocambra.com>
parent e1fb0508
No related branches found
No related tags found
No related merge requests found
......@@ -149,6 +149,26 @@
return show.episodes[indexPath.item];
}
- (NSIndexPath *)indexPathForLibraryItem:(id<VLCMediaLibraryItemProtocol>)libraryItem
{
__block NSInteger showEpisodeIndex = NSNotFound;
const NSInteger showIndex =
[self.showsArray indexOfObjectPassingTest:^BOOL(VLCMediaLibraryShow * const show,
const NSUInteger idx,
BOOL * const stop) {
showEpisodeIndex =
[show.episodes indexOfObjectPassingTest:^BOOL(VLCMediaLibraryMediaItem * const item,
const NSUInteger idx,
BOOL * const stop) {
return item.libraryID == libraryItem.libraryID;
}];
return showEpisodeIndex != NSNotFound;
}];
return showIndex != NSNotFound
? [NSIndexPath indexPathForItem:showEpisodeIndex inSection:showIndex]
: nil;
}
- (NSArray<VLCLibraryRepresentedItem *> *)representedItemsAtIndexPaths:(NSSet<NSIndexPath *> *const)indexPaths
forCollectionView:(NSCollectionView *)collectionView
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment