Commit d5b71e51 authored by Alessio Pollero's avatar Alessio Pollero Committed by Felix Paul Kühne

Fix missing title inside Apple TV Network Stream List (refs #16976)

Signed-off-by: Felix Paul Kühne's avatarFelix Paul Kühne <fkuehne@videolan.org>
parent 125060fd
......@@ -18,6 +18,7 @@
@interface VLCOpenNetworkStreamTVViewController ()
{
NSMutableArray *_recentURLs;
NSMutableDictionary *_recentURLTitles;
}
@property (nonatomic) NSIndexPath *currentlyFocusedIndexPath;
@end
......@@ -62,14 +63,17 @@
/* fetch data from cloud */
_recentURLs = [NSMutableArray arrayWithArray:[ubiquitousKeyValueStore arrayForKey:kVLCRecentURLs]];
_recentURLTitles = [NSMutableDictionary dictionaryWithDictionary:[ubiquitousKeyValueStore dictionaryForKey:kVLCRecentURLTitles]];
[self.previouslyPlayedStreamsTableView reloadData];
[super viewWillAppear:animated];
}
- (void)ubiquitousKeyValueStoreDidChange:(NSNotification *)notification
{
/* TODO: don't blindly trust that the Cloud knows best */
_recentURLs = [NSMutableArray arrayWithArray:[[NSUbiquitousKeyValueStore defaultStore] arrayForKey:kVLCRecentURLs]];
_recentURLTitles = [NSMutableDictionary dictionaryWithDictionary:[[NSUbiquitousKeyValueStore defaultStore] dictionaryForKey:kVLCRecentURLTitles]];
[self.previouslyPlayedStreamsTableView reloadData];
}
......@@ -88,9 +92,11 @@
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"RecentlyPlayedURLsTableViewCell"];
}
NSString *content = _recentURLs[indexPath.row];
cell.textLabel.text = [content lastPathComponent];
NSString *content = [_recentURLs[indexPath.row] stringByRemovingPercentEncoding];
NSString *possibleTitle = _recentURLTitles[[@(indexPath.row) stringValue]];
cell.detailTextLabel.text = content;
cell.textLabel.text = (possibleTitle != nil) ? possibleTitle : [content lastPathComponent];
return cell;
}
......
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