From 5d36b3a0c315a8671416087f8f8e5e2ef6e5357d Mon Sep 17 00:00:00 2001 From: dpavlin Date: Mon, 10 Oct 2005 13:57:29 +0000 Subject: [PATCH] r8441@llin: dpavlin | 2005-10-10 15:54:14 +0200 update total_size in archives git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/BackupPC/trunk@164 8392b6e1-25fa-0310-8288-cc32f8e212ea --- lib/BackupPC/CGI/BurnMedia.pm | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/BackupPC/CGI/BurnMedia.pm b/lib/BackupPC/CGI/BurnMedia.pm index 9934775..18d63a3 100644 --- a/lib/BackupPC/CGI/BurnMedia.pm +++ b/lib/BackupPC/CGI/BurnMedia.pm @@ -47,10 +47,7 @@ EOF } } - # convert to Kb - $total_size = $total_size / 1024; - - if ($total_size > $Conf{MaxArchiveSize}) { + if (($total_size / 1024) > $Conf{MaxArchiveSize}) { $cont .= eval( q{ ${h2(Error)}}); $cont .= "Selected backups size $total_size exceed max archive size $Conf{MaxArchiveSize}."; } else { @@ -62,18 +59,20 @@ EOF dvd_nr, note, username, - date + date, + total_size ) VALUES ( nextVal('archive_id_seq'), nextVal('dvd_nr'), ?, ?, - NOW() + NOW(), + ? ) }); # FIXME insert user here - $sth->execute($In{'note'}, 'dummy_user'); + $sth->execute($In{'note'}, 'dummy_user', $total_size); foreach my $backup_id (@selected_backup_ids) { @@ -104,7 +103,7 @@ EOF Archived following backups: } . join(", ", @selected_backup_ids) . q{
with total size of - } . sprintf("%1.2f Mb", $total_size / 1024) . q{ + } . sprintf("%1.2f Mb", $total_size / 1024 / 1024) . q{ to media } . $dvd_nr . q{ with following message:
-- 2.20.1