Skip to content
Browse files

Not showing blank tracks.

  • Loading branch information...
1 parent aeb680a commit 2e22aaed47dcecc8af9857bacfb3ce71a41b4bec @ryangrimm ryangrimm committed Apr 6, 2012
Showing with 12 additions and 4 deletions.
  1. +12 −4 Controllers/MLWFilterViewController.m
View
16 Controllers/MLWFilterViewController.m
@@ -156,9 +156,6 @@ - (UITableViewCell *)tableView:(UITableView *) tableView cellForRowAtIndexPath:(
NSArray *results = [self resultsForCurrentFacet];
CCFacetResult *facetResult = [results objectAtIndex:indexPath.row];
cell.textLabel.text = facetResult.label;
- if(self.tabs.selectedSegmentIndex == 1 && [facetResult.label isEqualToString:@""]) {
- cell.textLabel.text = @"Unspecified";
- }
if(self.tabs.selectedSegmentIndex == 1) {
cell.detailTextLabel.text = [NSString stringWithFormat:@"%i", facetResult.count];
}
@@ -275,8 +272,19 @@ - (NSArray *)resultsForCurrentFacet {
return [cleaned1 localizedCompare:cleaned2];
}];
}
- self.cachedResultsForCurrentFacet = results;
+ if([facetName isEqualToString:@"track"]) {
+ NSMutableArray *filteredResults = [NSMutableArray arrayWithCapacity:results.count];
+ for(CCFacetResult *result in results) {
+ if([result.label isEqualToString:@""]) {
+ continue;
+ }
+ [filteredResults addObject:result];
+ }
+ results = filteredResults;
+ }
+
+ self.cachedResultsForCurrentFacet = results;
return results;
}

0 comments on commit 2e22aae

Please sign in to comment.
Something went wrong with that request. Please try again.