summaryrefslogtreecommitdiffstats
path: root/lib/batch.lib.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/batch.lib.php')
-rw-r--r--lib/batch.lib.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/batch.lib.php b/lib/batch.lib.php
index 3d22a72f..5cb8494f 100644
--- a/lib/batch.lib.php
+++ b/lib/batch.lib.php
@@ -57,10 +57,23 @@ function send_zip( $name, $song_files ) {
'storepaths' => 0, // only store file name, not full path
'level' => 0 // no compression
);
+
$arc->set_options( $options );
$arc->add_files( $song_files );
- $arc->create_archive();
- $arc->download_file();
+ if (count($arc->error)) {
+ if (conf('debug')) {
+ log_event($GLOBALS['user']->username,'archive',"Error: unable to add songs");
+
+ }
+ } // if failed to add songs
+ if (!$arc->create_archive()) {
+ if (conf('debug')) {
+ log_event($GLOBALS['user']->username,'archive',"Error: unable to create archive");
+ }
+ } // if failed to create archive
+
+ $arc->download_file();
+
} // send_zip
?>