diff options
author | Paul 'flowerysong' Arthur <flowerysong00@yahoo.com> | 2010-03-14 20:14:52 +0000 |
---|---|---|
committer | Paul 'flowerysong' Arthur <flowerysong00@yahoo.com> | 2010-03-14 20:14:52 +0000 |
commit | 1cb0983ed04c65e06d502ae2ac9ed6d5e31d70dc (patch) | |
tree | 54655ff3e692a71a17f1d37cd97374b263557ca1 /lib/batch.lib.php | |
parent | ef48bf3fbdca2a4d25f5d025f4c6ad23905e5369 (diff) | |
download | ampache-1cb0983ed04c65e06d502ae2ac9ed6d5e31d70dc.tar.gz ampache-1cb0983ed04c65e06d502ae2ac9ed6d5e31d70dc.tar.bz2 ampache-1cb0983ed04c65e06d502ae2ac9ed6d5e31d70dc.zip |
Cosmetics: remove trailing whitespace
Diffstat (limited to 'lib/batch.lib.php')
-rw-r--r-- | lib/batch.lib.php | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/lib/batch.lib.php b/lib/batch.lib.php index aca73874..e79a55d0 100644 --- a/lib/batch.lib.php +++ b/lib/batch.lib.php @@ -8,7 +8,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License v2 as published by the Free Software Foundation. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -28,20 +28,20 @@ */ function get_song_files($media_ids) { - $media_files = array(); - + $media_files = array(); + foreach ($media_ids as $element) { - if (is_array($element)) { - $type = array_shift($element); - $media = new $type(array_shift($element)); - } - else { - $media = new Song($element); - } - if ($media->enabled) { + if (is_array($element)) { + $type = array_shift($element); + $media = new $type(array_shift($element)); + } + else { + $media = new Song($element); + } + if ($media->enabled) { $total_size += sprintf("%.2f",($media->size/1048576)); array_push($media_files, $media->file); - } + } } return array($media_files,$total_size); @@ -59,19 +59,19 @@ function send_zip( $name, $song_files ) { // Check if they want to save it to a file, if so then make sure they've got // a defined path as well and that it's writeable - if (Config::get('file_zip_download') && Config::get('file_zip_path')) { + if (Config::get('file_zip_download') && Config::get('file_zip_path')) { // Check writeable - if (!is_writable(Config::get('file_zip_path'))) { - $in_memory = '1'; - debug_event('Error','File Zip Path:' . Config::get('file_zip_path') . ' is not writeable','1'); - } - else { - $in_memory = '0'; - $basedir = Config::get('file_zip_path'); - } + if (!is_writable(Config::get('file_zip_path'))) { + $in_memory = '1'; + debug_event('Error','File Zip Path:' . Config::get('file_zip_path') . ' is not writeable','1'); + } + else { + $in_memory = '0'; + $basedir = Config::get('file_zip_path'); + } } else { - $in_memory = '1'; + $in_memory = '1'; } // if file downloads /* Require needed library */ @@ -84,20 +84,20 @@ function send_zip( $name, $song_files ) { 'level' => 0, // no compression 'comment' => Config::get('file_zip_comment') ); - + $arc->set_options( $options ); $arc->add_files( $song_files ); - if (count($arc->error)) { + if (count($arc->error)) { debug_event('archive',"Error: unable to add songs",'3'); - return false; + return false; } // if failed to add songs - - if (!$arc->create_archive()) { + + if (!$arc->create_archive()) { debug_event('archive',"Error: unable to create archive",'3'); - return false; + return false; } // if failed to create archive - + $arc->download_file(); } // send_zip |