- fixed problem with determining file size of tgz on disk: if there is no file, it...
[BackupPC.git] / lib / BackupPC / CGI / BurnMedia.pm
index 0bd4bff..e6beac2 100644 (file)
@@ -41,19 +41,22 @@ EOF
                my $selected = 0;
 
                my $parts = 1;
-
                foreach my $key(keys(%In)) {
+                       print LOG "doing $key...";
                        if ($key =~ m/^fcb([0-9]+)_([0-9]+)_([0-9]+)$/gi) {
+
                                my ($host_id, $backup_num, $backup_id) = ($1,$2,$3);
                                push @selected_backup_ids, $backup_id;
-                               $total_size += BackupPC::SearchLib::getGzipSize($host_id, $backup_num);
+                               my $currSize = BackupPC::SearchLib::getGzipSize($host_id, $backup_num);
+                               if ($currSize > 0) {
+                                       $total_size += currSize;
+                               }
                                $selected++;
 
                                my ($this_part) = $dbh->selectrow_array("select parts from backups where id = ?", undef, $backup_id);
                                $this_part--;
                                $parts += $this_part;
-                       }
-               }
+                       }               }
 
                if ($total_size > ($Conf{MaxArchiveSize} * $parts)) {
                        $cont .= eval( q{ ${h2(Error)}});