- for( int i=0; i<mwindow->edl->nested_edls.size(); ++i ) {
- EDL *nested_edl = mwindow->edl->nested_edls[i];
- mwindow->mainindexes->add_next_asset(0, nested_edl);
+ if( prev_edl != mwindow->edl ) {
+ for( int i=0; i<mwindow->edl->nested_edls.size(); ++i ) {
+ EDL *nested_edl = mwindow->edl->nested_edls[i];
+ if( !nested_edl->path[0] ) continue;
+ int k = prev_edl->nested_edls.size();
+ while( --k >= 0 && // if nested edl was updated, force index rebuild
+ strcmp(nested_edl->path, prev_edl->nested_edls[k]->path) );
+ if( k >= 0 && prev_edl->nested_edls[k]->equivalent_output(nested_edl) >= 0 )
+ IndexFile::delete_index_files(mwindow->preferences, nested_edl);
+ mwindow->mainindexes->add_indexable(nested_edl);
+ }
+ prev_edl->remove_user();