Changeset 1288 for trunk

Show
Ignore:
Timestamp:
06/23/10 14:20:40 (2 years ago)
Author:
gbooker
Message:

XML is a case where the cache doesn't hold the values, so fetch the real value in this case.
Make sure XML values do override movie values where appropriate.
Fixes #373

Location:
trunk/SapphireFrappliance
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/SapphireFrappliance/MetaData/SapphireMObjects/SapphireMovie.m

    r1251 r1288  
    302302                                        [mutRet addObject:cast]; 
    303303                                else 
    304                                         SapphireLog(SAPPHIRE_LOG_METADATA_STORE, SAPPHIRE_LOG_LEVEL_ERROR, @"Could not locate cast member %@ of movie %@", castName, self.title); 
     304                                        [mutRet addObject:[SapphireCast createCast:castName inContext:[self managedObjectContext]]]; 
    305305                        } 
    306306                        [castByName release]; 
     
    361361                                        [mutRet addObject:genre]; 
    362362                                else 
    363                                         SapphireLog(SAPPHIRE_LOG_METADATA_STORE, SAPPHIRE_LOG_LEVEL_ERROR, @"Could not locate genre %@ of movie %@", genreName, self.title); 
     363                                        [mutRet addObject:[SapphireGenre createGenre:genreName inContext:[self managedObjectContext]]]; 
    364364                        } 
    365365                        [genreByName release]; 
     
    529529} 
    530530 
     531- (NSString *)MPAARating 
     532{ 
     533        overrideWithXMLForKey(NSString, MPAARating); 
     534        return super.MPAARating; 
     535} 
     536 
     537- (NSNumber *)imdbRating 
     538{ 
     539        overrideWithXMLForKey(NSNumber, imdbRating); 
     540        return super.imdbRating; 
     541} 
     542 
    531543- (BOOL)castMemberHasMajorRoleStatus:(SapphireCast *)cast 
    532544{ 
  • trunk/SapphireFrappliance/MetaData/SapphireMObjects/SapphireXMLData.m

    r1272 r1288  
    188188                self.releaseDate = releaseDate; 
    189189         
     190        NSNumber *userRating = [dict objectForKey:META_SHOW_FAVORITE_RATING_KEY]; 
     191        if(userRating != nil) 
     192                self.imdbRating = userRating; 
     193         
     194        NSString *rating = [dict objectForKey:META_SHOW_RATING_KEY]; 
     195        if(rating != nil) 
     196                self.MPAARating = rating; 
     197         
    190198         
    191199        NSArray *arrVal = [dict objectForKey:META_MOVIE_CAST_KEY]; 
  • trunk/SapphireFrappliance/MetaDataImporting/SapphireXMLFileDataImporter.m

    r1255 r1288  
    8787                                                   nil] ; 
    8888        xmlMultiAttributes = [[NSDictionary alloc] initWithObjectsAndKeys: 
    89                                                   @"Genres",                            GENRES_XML_QUERY, 
    90                                                   @"Cast",                              CAST_XML_QUERY, 
    91                                                   @"Producers" ,                        PRODUCERS_XML_QUERY, 
    92                                                   @"Directors",                 DIRECTORS_XML_QUERY,nil]; 
     89                                                  META_MOVIE_GENRES_KEY,                        GENRES_XML_QUERY, 
     90                                                  META_MOVIE_CAST_KEY,                          CAST_XML_QUERY, 
     91                                                  @"Producers",                                         PRODUCERS_XML_QUERY, 
     92                                                  META_MOVIE_DIRECTOR_KEY,                      DIRECTORS_XML_QUERY,nil]; 
    9393} 
    9494