Show
Ignore:
Timestamp:
02/23/10 16:51:22 (2 years ago)
Author:
gbooker
Message:

Better handle files without extensions and preserve the lookup name better.
Fixes #283

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/PlayerFramework/SapphireFrappliance/MetaDataImporting/SapphireTVShowImporter.m

    r1138 r1165  
    286286                SapphireShowChooser *chooser = [[SapphireShowChooser alloc] initWithScene:[delegate chooserScene]]; 
    287287                [chooser setShows:shows]; 
    288                 [chooser setFileName:[NSString stringByCroppingDirectoryPath:state->path toLength:3]];           
     288                [chooser setFileName:[NSString stringByCroppingDirectoryPath:state->path toLength:3]]; 
    289289                [chooser setListTitle:BRLocalizedString(@"Select Show Title", @"Prompt the user for showname with a file")]; 
    290290                /*And display prompt*/ 
     
    593593                return ImportStateNotUpdated; 
    594594        //      NSArray *pathComponents = [path pathComponents]; 
     595        NSString *extLessPath = path; 
     596        if([metaData fileContainerTypeValue] != FILE_CONTAINER_TYPE_VIDEO_TS) 
     597                extLessPath = [extLessPath stringByDeletingPathExtension]; 
     598 
    595599        NSString *fileName = [path lastPathComponent]; 
    596600         
     
    704708        { 
    705709                BOOL nfoPathIsDir = NO; 
    706                 NSString *nfoFilePath=[[path stringByDeletingPathExtension] stringByAppendingPathExtension:@"nfo"]; 
     710                NSString *nfoFilePath=[extLessPath stringByAppendingPathExtension:@"nfo"]; 
    707711                NSString *showPath = nil; 
    708712                if([[NSFileManager defaultManager] fileExistsAtPath:nfoFilePath isDirectory:&nfoPathIsDir] && !nfoPathIsDir)