| 101 | | |
| 102 | | subDirs = [[NSArray alloc] initWithObjects: |
| 103 | | all, |
| 104 | | cast, |
| 105 | | director, |
| 106 | | genre, |
| 107 | | top250, |
| 108 | | oscar, |
| 109 | | nil]; |
| 110 | | names = [[NSArray alloc] initWithObjects: |
| 111 | | BRLocalizedString( @"All Movies", @"Select all movies" ), |
| 112 | | BRLocalizedString( @"By Cast", @"Select movies based on cast members" ), |
| 113 | | BRLocalizedString( @"By Director", @"Select movies based on director" ), |
| 114 | | BRLocalizedString( @"By Genre", @"Select movies based on genre" ), |
| 115 | | BRLocalizedString( @"IMDB Top 250", @"Show movies in IMDb Top 250 only" ), |
| 116 | | BRLocalizedString( @"Academy Award Winning", @"Show Oscar winning movies only" ), |
| 117 | | nil]; |
| 118 | | |
| | 103 | |
| | 104 | originalSubDirs = [[NSArray alloc] initWithObjects: |
| | 105 | all, |
| | 106 | cast, |
| | 107 | director, |
| | 108 | genre, |
| | 109 | top250, |
| | 110 | oscar, |
| | 111 | nil]; |
| | 112 | |
| | 113 | originalNames = [[NSArray alloc] initWithObjects: |
| | 114 | BRLocalizedString( @"All Movies", @"Select all movies" ), |
| | 115 | BRLocalizedString( @"By Cast", @"Select movies based on cast members" ), |
| | 116 | BRLocalizedString( @"By Director", @"Select movies based on director" ), |
| | 117 | BRLocalizedString( @"By Genre", @"Select movies based on genre" ), |
| | 118 | BRLocalizedString( @"IMDB Top 250", @"Show movies in IMDb Top 250 only" ), |
| | 119 | BRLocalizedString( @"Academy Award Winning", @"Show Oscar winning movies only" ), |
| | 120 | nil]; |
| | 121 | |
| | 222 | /*Import any defined movie virtual directories*/ |
| | 223 | NSArray *newVirtualDirs = [vdImport virtualDirectories]; |
| | 224 | if(![virtualDirs isEqualToArray:newVirtualDirs]) |
| | 225 | { |
| | 226 | [virtualDirs release]; |
| | 227 | [names release]; |
| | 228 | [subDirs release]; |
| | 229 | virtualDirs = [newVirtualDirs retain]; |
| | 230 | names = [originalNames mutableCopy]; |
| | 231 | subDirs = [originalSubDirs mutableCopy]; |
| | 232 | |
| | 233 | NSString *moviePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"video_H" ofType:@"png"]; |
| | 234 | NSEnumerator *mvdEnum = [newVirtualDirs objectEnumerator]; |
| | 235 | SapphireMovieVirtualDirectory *virtualDir; |
| | 236 | while((virtualDir = [mvdEnum nextObject]) != nil) |
| | 237 | { |
| | 238 | SapphireFilteredFileDirectory *custom = [[SapphireFilteredFileDirectory alloc] initWithPredicate:[virtualDir predicate] Context:moc]; |
| | 239 | [subDirs addObject:custom]; |
| | 240 | [names addObject:BRLocalizedString([virtualDir title], [virtualDir description])]; |
| | 241 | [custom setPath:[[VIRTUAL_DIR_ROOT_PATH stringByAppendingString:@"/"] stringByAppendingString:[virtualDir description]]]; |
| | 242 | [custom setCoverArtPath:moviePath]; // Change this to be part of the XML? |
| | 243 | [custom setFileSorters:defaultSorters]; |
| | 244 | NSLog(@"Added %@, %@: %@", [names lastObject], [virtualDir predicate],[subDirs lastObject]); |
| | 245 | [custom release]; |
| | 246 | } |
| | 247 | } |
| | 248 | |