Changeset 1026

Show
Ignore:
Timestamp:
10/21/07 22:12:59 (15 months ago)
Author:
stephen_booth
Message:

Handle re-addition of files containing embedded cue sheets

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/AudioLibrary/AudioLibrary.m

    r1025 r1026  
    835835                 
    836836                while((cueSheetTrack = [enumerator nextObject])) { 
     837                        // If the stream already exists in the library, skip it 
     838                        AudioStream *stream = [[[CollectionManager manager] streamManager] streamForURL:[NSURL fileURLWithPath:filename]  
     839                                                                                                                                                          startingFrame:[cueSheetTrack valueForKey:StreamStartingFrameKey]  
     840                                                                                                                                                                 frameCount:[cueSheetTrack valueForKey:StreamFrameCountKey]]; 
     841                        if(nil != stream) 
     842                                continue; 
     843 
    837844                        // Create a dictionary containing all applicable keys for this stream 
    838845                        NSMutableDictionary *values = [NSMutableDictionary dictionaryWithDictionary:[propertiesReader properties]]; 
     
    841848                         
    842849                        // Insert the object in the database 
    843                         AudioStream *stream = [AudioStream insertStreamForURL:[NSURL fileURLWithPath:filename] withInitialValues:values]; 
     850                        stream = [AudioStream insertStreamForURL:[NSURL fileURLWithPath:filename] withInitialValues:values]; 
    844851                         
    845852                        // Add the stream to the selected playlist