Added setting to skip archive generation if archive file is already present
This commit is contained in:
@@ -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')
|
||||
|
||||
@@ -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 = ''
|
||||
|
||||
Reference in New Issue
Block a user