@@ -24,13 +24,14 @@ def list_galleries_in(path): | |||
continue | |||
photos.sort(key=itemgetter("name")) | |||
cover_index = (len(gallery_dir.name) + 42) % len(photos) | |||
gallery = { | |||
"name": gallery_dir.name, | |||
"path": gallery_dir.path, | |||
"url": gallery_dir.name, | |||
"num_photos": len(photos), | |||
"photos": photos, | |||
"cover_photo": photos[0], | |||
"cover_photo": photos[cover_index], | |||
} | |||
yield gallery | |||