Index: /extensions/BatchDownloader/admin/sets.php
===================================================================
--- /extensions/BatchDownloader/admin/sets.php	(revision 17914)
+++ /extensions/BatchDownloader/admin/sets.php	(revision 17915)
@@ -80,6 +80,4 @@
     array(
       'USERNAME' => $username,
-      'STATUS' => $set->getParam('status'),
-      'LAST_ZIP' => $set->getParam('last_zip'),
       'U_DELETE' => BATCH_DOWNLOAD_ADMIN . '-sets&amp;delete='.$set->getParam('id'),
       'U_CANCEL' => BATCH_DOWNLOAD_ADMIN . '-sets&amp;cancel='.$set->getParam('id'),
Index: /extensions/BatchDownloader/include/BatchDownloader.class.php
===================================================================
--- /extensions/BatchDownloader/include/BatchDownloader.class.php	(revision 17914)
+++ /extensions/BatchDownloader/include/BatchDownloader.class.php	(revision 17915)
@@ -30,4 +30,5 @@
       'nb_images' => 0,
       'total_size' => 0,
+      'estimated_total_size' => 0,
       'status' => 'new',
       );
@@ -314,5 +315,4 @@
       $this->updateParam('last_zip', $this->data['last_zip']+1);
       $zip_path = $this->getArchivePath();
-      
       $zip = new myZip($zip_path, isset($conf['batch_download_force_pclzip']));
       
@@ -383,8 +383,9 @@
    * @return: int
    */
-  function getEstimatedTotalSize()
+  function getEstimatedTotalSize($force=false)
   {
     if ($this->data['status'] == 'done') return $this->data['total_size'];
     if ($this->data['nb_images'] == 0) return 0;
+    if ( !empty($this->data['estimated_total_size']) and !$force ) return $this->data['estimated_total_size'];
     
     $image_ids = array_slice(array_keys($this->images), 0, $this->conf['max_elements']);
@@ -396,4 +397,5 @@
 ;';
     list($total) = pwg_db_fetch_row(pwg_query($query));
+    $this->data['estimated_total_size'] = $total;
     return $total;
   }
@@ -462,30 +464,25 @@
     
     if ($i === null) $i = $this->data['last_zip'];
+    $set = $this->getNames();
     
     include_once(PHPWG_ROOT_PATH . 'admin/include/functions.php');
     
-    return BATCH_DOWNLOAD_LOCAL .'u-'. $this->data['user_id'] .'/'.
-          (!empty($this->conf['archive_prefix']) ? $this->conf['archive_prefix'] .'_' : null).
-          get_username($this->data['user_id']) .'_'. 
-          $this->data['type'] .'-'. $this->data['type_id'] .'_'.
-          $this->data['user_id'] . $this->data['id'] .
-          ($this->data['nb_zip']!=1 ? '_part'. $i : null).
-          '.zip';
-  }
-  
-  /**
-   * getSetInfo
+    $path = BATCH_DOWNLOAD_LOCAL . 'u-'. $this->data['user_id'] . '/';
+    $path.= !empty($this->conf['archive_prefix']) ? $this->conf['archive_prefix'] . '_' : null;
+    $path.= get_username($this->data['user_id']) . '_';
+    $path.= $set['BASENAME'] . '_';
+    $path.= $this->data['user_id'] . $this->data['id'];
+    $path.= $this->data['nb_zip']!=1 ? '_part' . $i : null;
+    $path.= '.zip';
+    
+    return $path;
+  }
+  
+  /**
+   * getNames
    * @return: array
    */
-  function getSetInfo()
-  {
-    $set = array(
-      'NB_IMAGES' => $this->data['nb_images'],
-      'NB_ARCHIVES' => $this->data['nb_zip'],
-      'TOTAL_SIZE' => ceil($this->getEstimatedTotalSize()/1024),
-      'LINKS' => $this->getDownloadList(BATCH_DOWNLOAD_PUBLIC . 'init_zip'),
-      'DATE_CREATION' => format_date($this->data['date_creation'], true),
-      );
-    
+  function getNames()
+  {    
     switch ($this->data['type'])
     {
@@ -517,4 +514,5 @@
         $set['NAME'] = l10n('Calendar').': '.$fields[$page['chronology_field']].$display_name;
         $set['sNAME'] = l10n('Calendar').': '.ltrim($display_name, $conf['level_separator']);
+        $set['BASENAME'] = 'calendar-'.$page['chronology_field'].'-'.implode('-',$page['chronology_date']);
         
         $page = $old_page;
@@ -529,4 +527,5 @@
         {
           $set['NAME'] = l10n('Album').': #'.$this->data['type_id'].' (deleted)';
+          $set['BASENAME'] = 'album'.$this->data['type_id'];
         }
         else
@@ -535,4 +534,17 @@
           $set['sNAME'] = l10n('Album').': '.trigger_event('render_category_name', $category['name']);
           $set['COMMENT'] = trigger_event('render_category_description', $category['comment']);
+          
+          if (!empty($category['permalink']))
+          {
+            $set['BASENAME'] = 'album-'.$category['permalink'];
+          }
+          else if ( ($name = str2url($category['name'])) != null )
+          {
+            $set['BASENAME'] = 'album-'.$name;
+          }
+          else
+          {
+            $set['BASENAME'] = 'album'.$this->data['type_id'];
+          }
         }
         break;
@@ -543,4 +555,5 @@
       {
         $set['NAME'] = l10n('Whole gallery');
+        $set['BASENAME'] = 'all-gallery';
         break;
       }
@@ -551,4 +564,5 @@
         $tags = find_tags(explode(',', $this->data['type_id']));
         $set['NAME'] = l10n('Tags').': ';
+        $set['BASENAME'] = 'tags';
         
         $first = true;
@@ -561,4 +575,5 @@
             .trigger_event('render_tag_name', $tag['name'])
             .'</a>';
+          $set['BASENAME'].= '-'.$tag['url_name'];
         }
         break;
@@ -569,4 +584,5 @@
       {
         $set['NAME'] = '<a href="'.make_index_url(array('section'=>'search', 'search'=>$this->data['type_id'])).'">'.l10n('Search').'</a>';
+        $set['BASENAME'] = 'search'.$this->data['type_id'];
         break;
       }
@@ -576,4 +592,5 @@
       {
         $set['NAME'] = '<a href="'.make_index_url(array('section'=>'favorites')).'">'.l10n('Your favorites').'</a>';
+        $set['BASENAME'] = 'favorites';
         break;
       }
@@ -583,4 +600,5 @@
       {
         $set['NAME'] = '<a href="'.make_index_url(array('section'=>'most_visited')).'">'.l10n('Most visited').'</a>';
+        $set['BASENAME'] = 'most-visited';
         break;
       }
@@ -590,4 +608,5 @@
       {
         $set['NAME'] = '<a href="'.make_index_url(array('section'=>'best_rated')).'">'.l10n('Best rated').'</a>';
+        $set['BASENAME'] = 'best-rated';
         break;
       }
@@ -597,4 +616,5 @@
       {
         $set['NAME'] = l10n('Random');
+        $set['BASENAME'] = 'random';
         break;
       }
@@ -604,4 +624,5 @@
       {
         $set['NAME'] = '<a href="'.make_index_url(array('section'=>'recent_pics')).'">'.l10n('Recent photos').'</a>';
+        $set['BASENAME'] = 'recent-pics';
         break;
       }
@@ -616,8 +637,18 @@
           $infos = $UserCollection->getCollectionInfo();
           $set['NAME'] = l10n('Collection').': <a href="'.$infos['U_PUBLIC'].'">'.$UserCollection->getParam('name').'</a>';
+          
+          if ( ($name = str2url($UserCollection->getParam('name'))) != null)
+          {
+            $set['BASENAME'] = 'collection-'.$name;
+          }
+          else
+          {
+            $set['BASENAME'] = 'collection'.$this->data['type_id'];
+          }
         }
         catch (Exception $e)
         {
           $set['NAME'] = l10n('Collection').': #'.$this->data['type_id'].' (deleted)';
+          $set['BASENAME'] = 'collection'.$this->data['type_id'];
         }
         break;
@@ -625,8 +656,28 @@
     }
     
-    if (!isset($set['sNAME']))   $set['sNAME'] = strip_tags($set['NAME']);
-    if (!isset($set['COMMENT'])) $set['COMMENT'] = null;
+    if (!isset($set['sNAME']))    $set['sNAME'] = strip_tags($set['NAME']);
+    if (!isset($set['COMMENT']))  $set['COMMENT'] = null;
+    if (!isset($set['BASENAME'])) $set['BASENAME'] = $this->data['type'] . $this->data['type_id'];
     
     return $set;
+  }
+  
+  /**
+   * getSetInfo
+   * @return: array
+   */
+  function getSetInfo()
+  {    
+    $set = array(
+      'NB_IMAGES' =>     $this->data['nb_images'],
+      'NB_ARCHIVES' =>   $this->data['nb_zip'],
+      'STATUS' =>        $this->data['status'],
+      'LAST_ZIP' =>      $this->data['last_zip'],
+      'TOTAL_SIZE' =>    ceil($this->getEstimatedTotalSize()/1024),
+      'LINKS' =>         $this->getDownloadList(BATCH_DOWNLOAD_PUBLIC . 'init_zip'),
+      'DATE_CREATION' => format_date($this->data['date_creation'], true),
+      );
+    
+    return array_merge($set, $this->getNames());
   }
 }
Index: /extensions/BatchDownloader/include/download.inc.php
===================================================================
--- /extensions/BatchDownloader/include/download.inc.php	(revision 17914)
+++ /extensions/BatchDownloader/include/download.inc.php	(revision 17915)
@@ -23,5 +23,5 @@
         pwg_query('DELETE FROM '.BATCH_DOWNLOAD_TSETS.' WHERE id = '.$_GET['set_id'].';');
         $_SESSION['page_infos'][] = l10n('Download set deleted');
-        redirect(get_root_url());
+        redirect(get_absolute_root_url());
       }
       
