Commit c6e07e23 authored by Carola Nitz's avatar Carola Nitz

VLCLibraryViewController: simplify code and fix playing wrong media when searching

parent e9870f66
......@@ -571,8 +571,9 @@ static NSString *kUsingTableViewToShowData = @"UsingTableViewToShowData";
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if ([(VLCPlaylistTableViewCell *)[tableView cellForRowAtIndexPath:indexPath] isExpanded]) {
[(VLCPlaylistTableViewCell *)[tableView cellForRowAtIndexPath:indexPath] collapsWithAnimation:YES];
VLCPlaylistTableViewCell *playlistTableViewCell = (VLCPlaylistTableViewCell *)[tableView cellForRowAtIndexPath:indexPath];
if ([playlistTableViewCell isExpanded]) {
[playlistTableViewCell collapsWithAnimation:YES];
return;
}
......@@ -594,10 +595,8 @@ static NSString *kUsingTableViewToShowData = @"UsingTableViewToShowData";
}
[tableView deselectRowAtIndexPath:indexPath animated:YES];
NSManagedObject *selectedObject = [_mediaDataSource objectAtIndex:indexPath.row];
if (selectedObject != nil)
[self openMediaObject:selectedObject];
[self openMediaObject:playlistTableViewCell.mediaObject];
}
#pragma mark - Gesture Action
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment