Browse Source

Added setting to skip archive generation if archive file is already present

pull/242/head
Alexandre Chataignon 9 years ago
parent
commit
fde26ec8de
  1. 4
      sigal/gallery.py
  2. 1
      sigal/templates/sigal.conf.py

4
sigal/gallery.py

@ -482,6 +482,10 @@ class Album(UnicodeMixin):
if zip_gallery and len(self) > 0:
archive_path = join(self.dst_path, zip_gallery)
if self.settings.get('zip_skip_if_exists', False) and isfile(archive_path):
self.logger.debug("Archive %s already created, passing", archive_path)
return zip_gallery
archive = zipfile.ZipFile(archive_path, 'w', allowZip64=True)
attr = ('src_path' if self.settings['zip_media_format'] == 'orig'
else 'dst_path')

1
sigal/templates/sigal.conf.py

@ -187,6 +187,7 @@ ignore_files = []
# contain all resized or original files (depending on `zip_media_format`).
# zip_gallery = False # False or 'archive.zip'
# zip_media_format = 'resized' # 'resized' or 'orig'
# zip_skip_if_exists = false # Skip archive generation if archive is already present. Warning: new photos in an album won't be added to archive
# Specify a different locale. If set to '', the default locale is used.
# locale = ''

Loading…
Cancel
Save