Commit c6e07e23 authored by Carola's avatar Carola
Browse files

VLCLibraryViewController: simplify code and fix playing wrong media when searching

parent e9870f66
...@@ -571,8 +571,9 @@ static NSString *kUsingTableViewToShowData = @"UsingTableViewToShowData"; ...@@ -571,8 +571,9 @@ static NSString *kUsingTableViewToShowData = @"UsingTableViewToShowData";
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{ {
if ([(VLCPlaylistTableViewCell *)[tableView cellForRowAtIndexPath:indexPath] isExpanded]) { VLCPlaylistTableViewCell *playlistTableViewCell = (VLCPlaylistTableViewCell *)[tableView cellForRowAtIndexPath:indexPath];
[(VLCPlaylistTableViewCell *)[tableView cellForRowAtIndexPath:indexPath] collapsWithAnimation:YES]; if ([playlistTableViewCell isExpanded]) {
[playlistTableViewCell collapsWithAnimation:YES];
return; return;
} }
...@@ -594,10 +595,8 @@ static NSString *kUsingTableViewToShowData = @"UsingTableViewToShowData"; ...@@ -594,10 +595,8 @@ static NSString *kUsingTableViewToShowData = @"UsingTableViewToShowData";
} }
[tableView deselectRowAtIndexPath:indexPath animated:YES]; [tableView deselectRowAtIndexPath:indexPath animated:YES];
NSManagedObject *selectedObject = [_mediaDataSource objectAtIndex:indexPath.row];
if (selectedObject != nil) [self openMediaObject:playlistTableViewCell.mediaObject];
[self openMediaObject:selectedObject];
} }
#pragma mark - Gesture Action #pragma mark - Gesture Action
......
Supports Markdown
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