summaryrefslogtreecommitdiffstats
path: root/lib/batch.lib.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-08-18 16:49:50 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-08-18 16:49:50 +0000
commitebd39247d9e7a4eda49ac3410197de1e1a2f2457 (patch)
tree8cd483816d3fa8d514bc63e618e2073be132365f /lib/batch.lib.php
parentccf03a68e2584835fb4d6fe3a6bc2e2cc780ce8c (diff)
downloadampache-ebd39247d9e7a4eda49ac3410197de1e1a2f2457.tar.gz
ampache-ebd39247d9e7a4eda49ac3410197de1e1a2f2457.tar.bz2
ampache-ebd39247d9e7a4eda49ac3410197de1e1a2f2457.zip
few mpd style tweaks, new archive lib and a new print_tags
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
?>