source: trunk/SapphireMetaData.h @ 125

Revision 125, 3.8 KB checked in by gbooker, 7 years ago (diff)
  • Redesigned a bit of the metadata display
  • Pull air dates from tvrage
  • Corrected values imported from XML to by right type
  • A few bug fixes
Line 
1//
2//  SapphireMetaData.h
3//  Sapphire
4//
5//  Created by Graham Booker on 6/22/07.
6//  Copyright 2007 __www.nanopi.net__. All rights reserved.
7//
8
9#import <Cocoa/Cocoa.h>
10#import "SapphirePredicates.h"
11
12#define META_TVRAGE_IMPORT_KEY                  @"TVRage Source"
13#define META_XML_IMPORT_KEY                             @"XML Source"
14
15//TV Show Specific Keys
16#define META_TITLE_KEY                                  @"Title"
17#define META_SEASON_NUMBER_KEY                  @"Season"
18#define META_EPISODE_NUMBER_KEY                 @"Episode"
19#define META_SHOW_NAME_KEY                              @"Show Name"
20#define META_DESCRIPTION_KEY                    @"Show Description"
21#define META_SHOW_AIR_DATE                              @"Air Date"
22#define META_RATING_KEY                                 @"Rating"
23#define META_SUMMARY_KEY                                @"Summary"
24#define META_ABSOLUTE_EP_NUMBER_KEY             @"Episode Number"
25
26//ATV Extra Info
27#define META_SHOW_BROADCASTER_KEY               @"Broadcast Company"
28#define META_SHOW_PUBLISHED_DATE_KEY    @"Published Date"
29#define META_SHOW_AQUIRED_DATE                  @"Date Aquired"
30#define META_SHOW_RATING_KEY                    @"Rating"
31#define META_SHOW_FAVORITE_RATING_KEY   @"User Rating"
32#define META_COPYRIGHT_KEY                              @"Copyright"
33
34//IMDB Type Info
35
36//Special Display Only Info
37#define META_EPISODE_AND_SEASON_KEY             @"S/E"
38
39@class SapphireMetaData, SapphireFileMetaData, SapphireDirectoryMetaData;
40
41@protocol SapphireMetaDataDelegate <NSObject>
42- (void)updateCompleteForFile:(NSString *)file;
43@end
44
45@interface SapphireMetaData : NSObject {
46        NSMutableDictionary                             *metaData;
47        SapphireMetaData                                *parent;
48        /* These two are not retained */
49        NSString                                                *path;
50        id <SapphireMetaDataDelegate>   delegate;
51}
52
53- (NSString *)path;
54
55- (void)setDelegate:(id <SapphireMetaDataDelegate>)newDelegate;
56- (void)writeMetaData;
57- (NSMutableDictionary *)getDisplayedMetaDataInOrder:(NSArray * *)order;
58
59@end
60
61@interface SapphireMetaDataCollection : SapphireMetaData {
62        SapphireDirectoryMetaData       *mainDirectory;
63        NSString                                        *dictionaryPath;
64}
65- (id)initWithFile:(NSString *)dictionary path:(NSString *)myPath;
66- (SapphireDirectoryMetaData *)rootDirectory;
67
68@end
69
70@interface SapphireDirectoryMetaData : SapphireMetaData {
71        /*These two are not retained*/
72        NSMutableDictionary     *metaFiles;
73        NSMutableDictionary     *metaDirs;
74       
75        NSMutableDictionary     *cachedMetaFiles;
76        NSMutableDictionary     *cachedMetaDirs;
77
78        NSMutableArray          *files;
79        NSMutableArray          *directories;
80       
81        NSTimer                         *importTimer;
82        NSMutableArray          *importArray;
83        BOOL                            scannedDirectory;
84}
85
86- (void)reloadDirectoryContents;
87- (NSArray *)files;
88- (NSArray *)directories;
89- (NSArray *)predicatedFiles:(SapphirePredicate *)predicate;
90- (NSArray *)predicatedDirectories:(SapphirePredicate *)predicate;
91
92- (SapphireFileMetaData *)metaDataForFile:(NSString *)file;
93- (SapphireDirectoryMetaData *)metaDataForDirectory:(NSString *)file;
94
95- (BOOL)pruneMetaData;
96- (BOOL)updateMetaData;
97
98- (void)cancelImport;
99- (void)resumeImport;
100- (void)resumeDelayedImport;
101
102- (SapphireMetaData *)metaDataForSubPath:(NSString *)path;
103- (NSArray *)subFileMetas;
104- (void)scanForNewFiles;
105
106- (BOOL)watchedForPredicate:(SapphirePredicate *)predicate;
107- (void)setWatched:(BOOL)watched predicate:(SapphirePredicate *)predicate;
108- (BOOL)favoriteForPredicate:(SapphirePredicate *)predicate;
109- (void)setFavorite:(BOOL)favorite predicate:(SapphirePredicate *)predicate;
110- (void)setToImportFromTVForPredicate:(SapphirePredicate *)predicate;
111
112@end
113
114@interface SapphireFileMetaData : SapphireMetaData {
115        NSDictionary            *combinedInfo;
116}
117
118- (BOOL) updateMetaData;
119
120- (int)modified;
121- (BOOL)watched;
122- (void)setWatched:(BOOL)watched;
123- (BOOL)favorite;
124- (void)setFavorite:(BOOL)favorite;
125- (long)importedTimeFromSource:(NSString *)source;
126- (void)setToImportFromSource:(NSString *)source;
127- (void)importInfo:(NSMutableDictionary *)newMeta fromSource:(NSString *)source withTime:(long)modTime;
128- (unsigned int)resumeTime;
129- (void)setResumeTime:(unsigned int)resumeTime;
130
131- (long long)size;
132- (float)duration;
133- (int)sampleRate;
134- (int)episodeNumber ;
135- (NSString *)episodeTitle ;
136
137- (NSString *)sizeString;
138
139@end
Note: See TracBrowser for help on using the repository browser.