source: branches/CoreData/SapphireFrappliance/MetaData/SapphireMObjects/SapphireFileMetaData.h @ 670

Revision 670, 6.1 KB checked in by gbooker, 6 years ago (diff)

Added ability to reset decisions made on a file (means importer will have to ask again). Useful if you selected the wrong thing

Line 
1#import "_SapphireFileMetaData.h"
2
3#define SapphireFileMetaDataName        @"FileMetaData"
4
5//ATV Extra Info
6extern NSString *META_SHOW_BROADCASTER_KEY;
7extern NSString *META_SHOW_PUBLISHED_DATE_KEY;
8extern NSString *META_SHOW_AQUIRED_DATE;
9extern NSString *META_SHOW_RATING_KEY;
10extern NSString *META_SHOW_FAVORITE_RATING_KEY;
11extern NSString *META_COPYRIGHT_KEY;
12
13//IMDB Type Info
14extern NSString *META_MOVIE_TITLE_KEY;
15extern NSString *META_MOVIE_CAST_KEY;
16extern NSString *META_MOVIE_RELEASE_DATE_KEY;
17extern NSString *META_MOVIE_DIRECTOR_KEY;
18extern NSString *META_MOVIE_WIRTERS_KEY;
19extern NSString *META_MOVIE_GENRES_KEY;
20extern NSString *META_MOVIE_PLOT_KEY;
21extern NSString *META_MOVIE_IMDB_RATING_KEY;
22extern NSString *META_MOVIE_IMDB_250_KEY;
23extern NSString *META_MOVIE_MPAA_RATING_KEY;
24extern NSString *META_MOVIE_OSCAR_KEY;
25extern NSString *META_MOVIE_IDENTIFIER_KEY;
26
27//TV Show Specific Keys
28extern NSString *META_TITLE_KEY;
29extern NSString *META_SEASON_NUMBER_KEY;
30extern NSString *META_EPISODE_NUMBER_KEY;
31extern NSString *META_SHOW_NAME_KEY;
32extern NSString *META_DESCRIPTION_KEY;
33extern NSString *META_SHOW_AIR_DATE;
34extern NSString *META_RATING_KEY;
35extern NSString *META_SUMMARY_KEY;
36extern NSString *META_ABSOLUTE_EP_NUMBER_KEY;
37extern NSString *META_SHOW_IDENTIFIER_KEY;
38extern NSString *META_EPISODE_2_NUMBER_KEY;
39extern NSString *META_ABSOLUTE_EP_2_NUMBER_KEY;
40extern NSString *META_SEARCH_SEASON_NUMBER_KEY;
41extern NSString *META_SEARCH_EPISODE_NUMBER_KEY;
42extern NSString *META_SEARCH_EPISODE_2_NUMBER_KEY;
43extern NSString *FILE_CLASS_KEY;
44
45typedef enum {
46        IMPORT_TYPE_FILE_MASK = 1,
47        IMPORT_TYPE_XML_MASK = 2,
48        IMPORT_TYPE_TVSHOW_MASK = 4,
49        IMPORT_TYPE_MOVIE_MASK = 8,
50        IMPORT_TYPE_ALL_MASK = 0xf,
51} ImportTypeMask;
52
53
54typedef enum {
55        FILE_CLASS_UTILITY= -2,
56        FILE_CLASS_NOT_FILE= -1,
57        FILE_CLASS_UNKNOWN = 0,
58        FILE_CLASS_TV_SHOW = 1,
59        FILE_CLASS_MOVIE = 2,
60        FILE_CLASS_AUDIO = 3,
61        FILE_CLASS_IMAGE = 4,
62        FILE_CLASS_OTHER = 5,
63} FileClass;
64
65typedef enum {
66        FILE_CONTAINER_TYPE_QT_MOVIE = 0,
67        FILE_CONTAINER_TYPE_VIDEO_TS = 1,
68} FileContainerType;
69
70@interface SapphireFileMetaData : _SapphireFileMetaData {}
71+ (SapphireFileMetaData *)fileWithPath:(NSString *)path inContext:(NSManagedObjectContext *)moc;
72+ (SapphireFileMetaData *)createFileWithPath:(NSString *)path inContext:(NSManagedObjectContext *)moc;
73+ (SapphireFileMetaData *)createFileWithPath:(NSString *)path parent:(SapphireDirectoryMetaData *)parent inContext:(NSManagedObjectContext *)moc;
74
75- (void)insertDictionary:(NSDictionary *)dict withDefer:(NSMutableDictionary *)defer;
76- (NSComparisonResult) episodeCompare:(SapphireFileMetaData *)other;
77- (NSComparisonResult) movieCompare:(SapphireFileMetaData *)other;
78
79/*!
80 * @brief See if any files need to be updated
81 *
82 * This function determines that a file needs to be updated if its modification time does not match the time remembered in the persistent store.
83 *
84 * @return YES if any files need an update, NO otherwise
85 */
86- (BOOL) needsUpdating;
87
88/*!
89 * @brief Update any files that need to be updated
90 *
91 * This function determines that a file needs to be updated if its modification time does not match the time remembered in the persistent store.
92 *
93 * @return YES if any files were updated, NO otherwise
94 */
95- (BOOL)updateMetaData;
96
97/*!
98 * @brief Adds File data read from the file
99 *
100 * @param fileMeta The new file metadata.
101 */
102- (oneway void)addFileData:(bycopy NSDictionary *)fileMeta;
103
104/*!
105 * @brief Returns the imports we have done in the past
106 *
107 * @return A mask of imports done
108 */
109- (ImportTypeMask)importTypeValue;
110
111/*!
112 * @brief Sets the file has having done an import, usually with no data
113 *
114 * @param The type of import done
115 */
116- (void)didImportType:(ImportTypeMask)type;
117
118/*!
119 * @brief Returns the time of import from a source (file and xml only)
120 *
121 * @param source The source to check
122 * @return The seconds since 1970 of the import
123 */
124- (long)importedTimeFromSource:(int)source;
125
126/*!
127 * @brief Sets the file to re-import from some sources
128 *
129 * @param mask The sources to reimport on
130 */
131- (void)setToReimportFromMask:(int)mask;
132
133/*!
134 * @brief Reset import decisions for this file (also mark to re-import)
135 */
136- (void)setToResetImportDecisions;
137
138/*!
139 * @brief Get the overridden season number
140 *
141 * Sometimes TVRage's information is horribly wrong (such as Firefly) and it would be a pain to correct.  This allows the user to provide a season number to override what is in the filename while not interferring with the number stored in the real season number.
142 *
143 * @return the season number to use, -1 if none exists
144 */
145- (int)searchSeasonNumber;
146
147/*!
148 * @brief Get the overridden episode number
149 *
150 * Sometimes TVRage's information is horribly wrong (such as Firefly) and it would be a pain to correct.  This allows the user to provide a episode number to override what is in the filename while not interferring with the number stored in the real episode number.
151 *
152 * @return the episode number to use, -1 if none exists
153 */
154- (int)searchEpisodeNumber;
155
156/*!
157 * @brief Get the overridden second episode number
158 *
159 * Sometimes TVRage's information is horribly wrong (such as Firefly) and it would be a pain to correct.  This allows the user to provide a second episode number to override what is in the filename while not interferring with the number stored in the real second episode number.
160 *
161 * @return the second episode number to use, -1 if none exists
162 */
163- (int)searchLastEpisodeNumber;
164
165/*!
166 * @brief Returns the size as a string
167 *
168 * This will format the size in a human readable format.  It uses strings like 2.1GB and the like.  It always has one decimal number.
169 *
170 * @return The Size as a string.
171 */
172- (NSString *)sizeString;
173
174/*!
175 * @brief Clear the metadata
176 *
177 * Removes all metadata for this file.  Useful if the user misidentified the file and wishes to start over on it.
178 */
179- (void)clearMetaData;
180
181/*!
182 * @brief Get the cover art Path
183 *
184 * Returns the cover art path.  It will also examine up in the directory structure in order to find the cover art.  It examines both the current directory, the "cover art" subdirectory, and the same for parent directories up to 2 levels.
185 *
186 * @return The path for the cover art, nil if none found
187 */
188- (NSString *)coverArtPath;
189
190@end
Note: See TracBrowser for help on using the repository browser.