| | 180 | } |
| | 181 | |
| | 182 | + (void)importV1Store:(NSManagedObjectContext *)v1Context intoContext:(NSManagedObjectContext *)context withDisplay:(SapphireMetaDataUpgrading *)display |
| | 183 | { |
| | 184 | [display setCurrentFile:@"Upgrading Cast"]; |
| | 185 | NSDictionary *castLookup = [SapphireCast upgradeV1CastFromContext:v1Context toContext:context]; |
| | 186 | [display setCurrentFile:@"Upgrading Directors"]; |
| | 187 | NSDictionary *directorLookup = [SapphireDirector upgradeV1DirectorsFromContext:v1Context toContext:context]; |
| | 188 | [display setCurrentFile:@"Upgrading Genres"]; |
| | 189 | NSDictionary *genreLookup = [SapphireGenre upgradeV1GenresFromContext:v1Context toContext:context]; |
| | 190 | [display setCurrentFile:@"Upgrading Movies"]; |
| | 191 | NSDictionary *movieLookup = [SapphireMovie upgradeV1MoviesFromContext:v1Context toContext:context withCast:castLookup directors:directorLookup genres:genreLookup]; |
| | 192 | [display setCurrentFile:@"Upgrading Shows"]; |
| | 193 | [SapphireTVShow upgradeV1ShowsFromContext:v1Context toContext:context]; |
| | 194 | [display setCurrentFile:@"Upgrading Directories"]; |
| | 195 | NSDictionary *dirLookup = [SapphireDirectoryMetaData upgradeV1DirectoriesFromContext:v1Context toContext:context]; |
| | 196 | [display setCurrentFile:@"Upgrading Files"]; |
| | 197 | NSDictionary *fileLookup = [SapphireFileMetaData upgradeV1FilesFromContext:v1Context toContext:context withMovies:movieLookup directories:dirLookup]; |
| | 198 | [display setCurrentFile:@"Upgrading SymLinks"]; |
| | 199 | [SapphireDirectorySymLink upgradeV1DirLinksFromContext:v1Context toContext:context directories:dirLookup]; |
| | 200 | [SapphireFileSymLink upgradeV1FileLinksFromContext:v1Context toContext:context directories:dirLookup file:fileLookup]; |
| | 201 | [display setCurrentFile:@"Upgrading Joined Files"]; |
| | 202 | [SapphireJoinedFile upgradeV1JoinedFileFromContext:v1Context toContext:context file:fileLookup]; |
| | 203 | [display setCurrentFile:@"Upgrading Episodes"]; |
| | 204 | [SapphireEpisode upgradeV1EpisodesFromContext:v1Context toContext:context file:fileLookup]; |
| | 205 | [display setCurrentFile:@"Upgrading XML"]; |
| | 206 | [SapphireXMLData upgradeV1XMLFromContext:v1Context toContext:context file:fileLookup]; |