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

This commit is contained in:
Alexandre Chataignon
2017-03-03 06:37:11 +01:00
parent fc8e9b9b51
commit fde26ec8de
2 changed files with 5 additions and 0 deletions

View File

@@ -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')

View File

@@ -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 = ''