Changeset 1984
- Timestamp:
- 04/18/08 12:08:50 (6 months ago)
- Files:
-
- branches/release-35/lib/MT/BackupRestore.pm (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/release-35/lib/MT/BackupRestore.pm
r1948 r1984 167 167 my $counter = 1; 168 168 my $bytes = 0; 169 my %author_ids_seen; 169 my %authors_seen; 170 my $author_pkg = MT->model('author'); 170 171 for my $class_hash (@$obj_to_backup) { 171 172 my ($class, $term_arg) = each(%$class_hash); … … 217 218 } 218 219 $count++; 219 if ( ( $class eq MT->model('author'))220 && ( exists $author _ids_seen{$object->id} ) ) {220 if ( ( $class eq $author_pkg ) 221 && ( exists $authors_seen{$object->id} ) ) { 221 222 next; 222 223 } … … 227 228 $bytes = 0; 228 229 } 229 if ( $class eq MT->model('author')) {230 if ( $class eq $author_pkg ) { 230 231 # Authors may be duplicated because of how terms and args are created. 231 $author _ids_seen{$object->id} = 1;232 $authors_seen{$object->id} = 1; 232 233 } elsif ( $class->datasource eq 'asset' ) { 233 234 $files->{$object->id} = [$object->url, $object->file_path, $object->file_name]; … … 238 239 if $records && ($records % 100 == 0); 239 240 } 240 if ($records) { 241 if ( $class eq $author_pkg && %authors_seen ) { 242 my $count = scalar(keys %authors_seen); 243 $progress->($state . " " . MT->translate("[_1] records backed up.", $count), $class->class_type || $class->datasource); 244 } elsif ($records) { 241 245 $progress->($state . " " . MT->translate("[_1] records backed up.", $records), $class->class_type || $class->datasource); 242 246 } else {
