source: branches/CoreData/SapphireFrappliance/MetaData/Support/SapphireMovieCategories.m @ 598

Revision 598, 2.8 KB checked in by gbooker, 6 years ago (diff)
  • Changed cache structure to be more efficient on predicates
  • Use a less restrictive predicate for watched/favorite checking than the filter since the filter's is a bit more complex
  • Corrected sort mechanisms for many directories
  • Fixed browser's display of divider lines for both frontrow and take 2
RevLine 
[549]1/*
2 * SapphireMovieCategories.m
3 * Sapphire
4 *
5 * Created by Graham Booker on Apr. 9, 2008.
6 * Copyright 2008 Sapphire Development Team and/or www.nanopi.net
7 * All rights reserved.
8 *
9 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
10 * General Public License as published by the Free Software Foundation; either version 3 of the License,
11 * or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
14 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
15 * Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along with this program; if not,
18 * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19 */
[541]20
21#import "SapphireMovieCategories.h"
22#import "SapphireMovie.h"
23#import "SapphireObjectDirectory.h"
[585]24#import "SapphireBasicDirectoryFunctionsImports.h"
[541]25
26@implementation SapphireMovieCategories
27
28- (id)initWithMovie:(SapphireMovie *)mov
29{
30        self = [super init];
31        if(self == nil)
32                return self;
33       
34        movie = [mov retain];
35       
[552]36        SapphireObjectDirectory *cast = [[SapphireObjectDirectory alloc] initWithDirectory:movie andSubDirKey:@"orderedCast"];
37        SapphireObjectDirectory *directors = [[SapphireObjectDirectory alloc] initWithDirectory:movie andSubDirKey:@"orderedDirectors"];
38        SapphireObjectDirectory *genres = [[SapphireObjectDirectory alloc] initWithDirectory:movie andSubDirKey:@"orderedGenres"];
[541]39       
40        categories = [NSDictionary dictionaryWithObjectsAndKeys:
41                                  cast, @"Cast",
42                                  directors, @"Directors",
43                                  genres, @"Genres",
44                                  nil];
45       
46        [cast release];
47        [directors release];
48        [genres release];
[588]49        Basic_Directory_Function_Inits
50
[541]51        return self;
52}
53
54- (void) dealloc
55{
56        [movie release];
57        [categories release];
[554]58        Basic_Directory_Function_Deallocs
[541]59        [super dealloc];
60}
61
62- (NSArray *)files
63{
64        return [NSArray array];
65}
66
67- (NSArray *)directories
68{
[598]69        return [[categories allKeys] sortedArrayUsingSelector:@selector(nameCompare:)];
[541]70}
71
[551]72- (NSArray *)metaFiles
73{
74        return [NSArray array];
75}
76
[573]77- (NSPredicate *)metaFileFetchPredicate
78{
79        return nil;
80}
81
[541]82- (SapphireFileMetaData *)metaDataForFile:(NSString *)file
83{
84        return nil;
85}
86
87- (id <SapphireDirectory>)metaDataForDirectory:(NSString *)directory
88{
89        return [categories objectForKey:directory];
90}
91
92- (void)reloadDirectoryContents
93{
94}
95
96- (NSString *)path
97{
98        return nil;
99}
100
101- (NSManagedObjectContext *)managedObjectContext
102{
103        return [movie managedObjectContext];
104}
105
[551]106- (NSString *)coverArtPath
107{
108        return nil;
109}
110
[568]111- (void)refreshAllObjects
112{
113        [[movie managedObjectContext] refreshObject:movie mergeChanges:YES];
114}
115
[575]116- (id <SapphireDirectory>)parentDirectory
117{
118        return nil;
119}
[568]120
[575]121
[541]122#include "SapphireBasicDirectoryFunctions.h"
123
124@end
Note: See TracBrowser for help on using the repository browser.