Merge pull request #244 from xouillet/format_zip_name

gallery: Allow formatting in zip_gallery
This commit is contained in:
Simon Conseil
2017-03-03 09:44:11 +01:00
committed by GitHub
2 changed files with 3 additions and 1 deletions

View File

@@ -479,6 +479,7 @@ class Album(UnicodeMixin):
zip_gallery = self.settings['zip_gallery']
if zip_gallery and len(self) > 0:
zip_gallery = zip_gallery.format(album=self)
archive_path = join(self.dst_path, zip_gallery)
archive = zipfile.ZipFile(archive_path, 'w', allowZip64=True)
attr = ('src_path' if self.settings['zip_media_format'] == 'orig'

View File

@@ -183,7 +183,8 @@ ignore_files = []
# Example : {'tracker_url': 'http://stats.domain.com', 'site_id' : 2}
# piwik = {'tracker_url': '', 'site_id' : 0}
# Set zip_gallery to either False or a file name. The final archive will
# Set zip_gallery to either False or a file name. The file name can be formated
# python style with an 'album' variable, for example '{album.name}.zip'. The final archive will
# 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'